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
1d9672ec
Commit
1d9672ec
authored
Jun 17, 2004
by
Stefan Leichter
Committed by
Alexandre Julliard
Jun 17, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for GetAcceptLanguagesA.
parent
c71c514f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
1 deletion
+77
-1
ordinal.c
dlls/shlwapi/ordinal.c
+4
-0
ordinal.c
dlls/shlwapi/tests/ordinal.c
+73
-1
No files found.
dlls/shlwapi/ordinal.c
View file @
1d9672ec
...
...
@@ -540,6 +540,8 @@ HRESULT WINAPI GetAcceptLanguagesA(
HKEY
mykey
;
LCID
mylcid
;
if
(
!
langbuf
||
!
buflen
||
!*
buflen
)
return
E_FAIL
;
mystrlen
=
(
*
buflen
>
6
)
?
*
buflen
:
6
;
mystr
=
(
CHAR
*
)
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
mystrlen
);
...
...
@@ -591,6 +593,8 @@ HRESULT WINAPI GetAcceptLanguagesW(
HKEY
mykey
;
LCID
mylcid
;
if
(
!
langbuf
||
!
buflen
||
!*
buflen
)
return
E_FAIL
;
mystrlen
=
(
*
buflen
>
6
)
?
*
buflen
:
6
;
mystr
=
(
CHAR
*
)
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
mystrlen
);
...
...
dlls/shlwapi/tests/ordinal.c
View file @
1d9672ec
...
...
@@ -33,7 +33,77 @@
/* Function ptrs for ordinal calls */
static
HMODULE
hShlwapi
;
static
int
(
WINAPI
*
pSHSearchMapInt
)(
const
int
*
,
const
int
*
,
int
,
int
);
static
HRESULT
(
WINAPI
*
pGetAcceptLanguagesA
)(
LPSTR
,
LPDWORD
);
static
void
test_GetAcceptLanguagesA
(
void
)
{
HRESULT
retval
;
DWORD
buffersize
,
buffersize2
;
char
buffer
[
100
];
if
(
!
pGetAcceptLanguagesA
)
return
;
SetLastError
(
ERROR_SUCCESS
);
retval
=
pGetAcceptLanguagesA
(
NULL
,
NULL
);
ok
(
retval
==
E_FAIL
,
"function result wrong: got %08lx; expected E_FAIL
\n
"
,
retval
);
ok
(
ERROR_SUCCESS
==
GetLastError
(),
"last error set to %ld
\n
"
,
GetLastError
());
buffersize
=
sizeof
(
buffer
);
SetLastError
(
ERROR_SUCCESS
);
retval
=
pGetAcceptLanguagesA
(
NULL
,
&
buffersize
);
ok
(
retval
==
E_FAIL
,
"function result wrong: got %08lx; expected E_FAIL
\n
"
,
retval
);
ok
(
buffersize
==
sizeof
(
buffer
),
"buffersize was changed (2nd parameter; not on Win2k)
\n
"
);
ok
(
ERROR_SUCCESS
==
GetLastError
(),
"last error set to %ld
\n
"
,
GetLastError
());
SetLastError
(
ERROR_SUCCESS
);
retval
=
pGetAcceptLanguagesA
(
buffer
,
NULL
);
ok
(
retval
==
E_FAIL
,
"function result wrong: got %08lx; expected E_FAIL
\n
"
,
retval
);
ok
(
ERROR_SUCCESS
==
GetLastError
(),
"last error set to %ld
\n
"
,
GetLastError
());
buffersize
=
0
;
memset
(
buffer
,
0
,
sizeof
(
buffer
));
SetLastError
(
ERROR_SUCCESS
);
retval
=
pGetAcceptLanguagesA
(
buffer
,
&
buffersize
);
ok
(
retval
==
E_FAIL
,
"function result wrong: got %08lx; expected E_FAIL
\n
"
,
retval
);
ok
(
buffersize
==
0
,
"buffersize wrong(changed) got %08lx; expected 0 (2nd parameter; not on Win2k)
\n
"
,
buffersize
);
ok
(
ERROR_SUCCESS
==
GetLastError
(),
"last error set to %ld
\n
"
,
GetLastError
());
buffersize
=
buffersize2
=
1
;
memset
(
buffer
,
0
,
sizeof
(
buffer
));
retval
=
pGetAcceptLanguagesA
(
buffer
,
&
buffersize
);
todo_wine
ok
(
retval
==
E_INVALIDARG
,
"function result wrong: got %08lx; expected E_INVALIDARG
\n
"
,
retval
);
todo_wine
ok
(
buffersize
==
0
,
"buffersize wrong: got %08lx, expected 0 (2nd parameter;Win2k)
\n
"
,
buffersize
);
todo_wine
ok
(
ERROR_INSUFFICIENT_BUFFER
==
GetLastError
(),
"last error wrong: got %08lx; expected ERROR_INSUFFICIENT_BUFFER
\n
"
,
GetLastError
());
todo_wine
ok
(
buffersize2
==
strlen
(
buffer
),
"buffer content (length) wrong: got %08x, expected %08lx
\n
"
,
strlen
(
buffer
),
buffersize2
);
buffersize
=
sizeof
(
buffer
);
memset
(
buffer
,
0
,
sizeof
(
buffer
));
SetLastError
(
ERROR_SUCCESS
);
retval
=
pGetAcceptLanguagesA
(
buffer
,
&
buffersize
);
ok
(
retval
==
S_OK
,
"function result wrong: got %08lx, expected S_OK
\n
"
,
retval
);
ok
(
ERROR_SUCCESS
==
GetLastError
(),
"last error set to %ld
\n
"
,
GetLastError
());
buffersize
=
buffersize2
=
strlen
(
buffer
);
memset
(
buffer
,
0
,
sizeof
(
buffer
));
SetLastError
(
ERROR_SUCCESS
);
retval
=
pGetAcceptLanguagesA
(
buffer
,
&
buffersize
);
todo_wine
ok
(
retval
==
E_INVALIDARG
,
"function result wrong: got %08lx; expected E_INVALIDARG
\n
"
,
retval
);
todo_wine
ok
(
buffersize
==
0
,
"buffersize wrong: got %08lx, expected 0 (2nd parameter;Win2k)
\n
"
,
buffersize
);
todo_wine
ok
(
ERROR_INSUFFICIENT_BUFFER
==
GetLastError
(),
"last error wrong: got %08lx; expected ERROR_INSUFFICIENT_BUFFER
\n
"
,
GetLastError
());
ok
(
buffersize2
==
strlen
(
buffer
),
"buffer content (length) wrong: got %08x, expected %08lx
\n
"
,
strlen
(
buffer
),
buffersize2
);
}
static
void
test_SHSearchMapInt
(
void
)
{
...
...
@@ -84,8 +154,10 @@ START_TEST(ordinal)
if
(
!
hShlwapi
)
return
;
pGetAcceptLanguagesA
=
(
void
*
)
GetProcAddress
(
hShlwapi
,
(
LPSTR
)
14
);
pSHSearchMapInt
=
(
void
*
)
GetProcAddress
(
hShlwapi
,
(
LPSTR
)
198
);
test_GetAcceptLanguagesA
();
test_SHSearchMapInt
();
FreeLibrary
(
hShlwapi
);
}
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