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
95bb9032
Commit
95bb9032
authored
Aug 29, 2006
by
Paul Vriens
Committed by
Alexandre Julliard
Aug 29, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintrust: Add framework and initial tests.
parent
fc3c9c5e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
194 additions
and
0 deletions
+194
-0
configure
configure
+0
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/Makefile.in
+1
-0
Makefile.in
dlls/wintrust/tests/Makefile.in
+13
-0
register.c
dlls/wintrust/tests/register.c
+176
-0
Makefile.in
programs/winetest/Makefile.in
+3
-0
No files found.
configure
View file @
95bb9032
This diff is collapsed.
Click to expand it.
configure.ac
View file @
95bb9032
...
...
@@ -1738,6 +1738,7 @@ dlls/winspool.drv/Makefile
dlls/winspool.drv/tests/Makefile
dlls/wintab32/Makefile
dlls/wintrust/Makefile
dlls/wintrust/tests/Makefile
dlls/wldap32/Makefile
dlls/wnaspi32/Makefile
dlls/wow32/Makefile
...
...
dlls/Makefile.in
View file @
95bb9032
...
...
@@ -259,6 +259,7 @@ TESTSUBDIRS = \
wininet/tests
\
winmm/tests
\
winspool.drv/tests
\
wintrust/tests
\
ws2_32/tests
SUBDIRS
=
\
...
...
dlls/wintrust/tests/Makefile.in
0 → 100644
View file @
95bb9032
TOPSRCDIR
=
@top_srcdir@
TOPOBJDIR
=
../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
wintrust.dll
IMPORTS
=
user32 kernel32
CTESTS
=
\
register.c
@MAKE_TEST_RULES@
### Dependencies:
dlls/wintrust/tests/register.c
0 → 100644
View file @
95bb9032
/* Unit test suite for wintrust API functions
*
* Copyright 2006 Paul Vriens
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#include <stdarg.h>
#include <stdio.h>
#include "windows.h"
#include "softpub.h"
#include "wintrust.h"
#include "wine/test.h"
static
BOOL
(
WINAPI
*
pWintrustAddActionID
)(
GUID
*
,
DWORD
,
CRYPT_REGISTER_ACTIONID
*
);
static
BOOL
(
WINAPI
*
pWintrustRemoveActionID
)(
GUID
*
);
static
HMODULE
hWintrust
=
0
;
#define WINTRUST_GET_PROC(func) \
p ## func = (void*)GetProcAddress(hWintrust, #func); \
if(!p ## func) { \
trace("GetProcAddress(%s) failed\n", #func); \
FreeLibrary(hWintrust); \
return FALSE; \
}
static
BOOL
InitFunctionPtrs
(
void
)
{
hWintrust
=
LoadLibraryA
(
"wintrust.dll"
);
if
(
!
hWintrust
)
{
trace
(
"Could not load wintrust.dll
\n
"
);
return
FALSE
;
}
WINTRUST_GET_PROC
(
WintrustAddActionID
)
WINTRUST_GET_PROC
(
WintrustRemoveActionID
)
return
TRUE
;
}
static
void
test_AddRem_ActionID
(
void
)
{
static
WCHAR
DummyDllW
[]
=
{
'd'
,
'e'
,
'a'
,
'd'
,
'b'
,
'e'
,
'e'
,
'f'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
static
WCHAR
DummyFunctionW
[]
=
{
'd'
,
'u'
,
'm'
,
'm'
,
'y'
,
'f'
,
'u'
,
'n'
,
'c'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
GUID
ActionID
=
{
0xdeadbe
,
0xefde
,
0xadbe
,
{
0xef
,
0xde
,
0xad
,
0xbe
,
0xef
,
0xde
,
0xad
,
0xbe
}};
CRYPT_REGISTER_ACTIONID
ActionIDFunctions
;
CRYPT_TRUST_REG_ENTRY
EmptyProvider
=
{
0
,
NULL
,
NULL
};
CRYPT_TRUST_REG_ENTRY
DummyProvider
=
{
sizeof
(
CRYPT_TRUST_REG_ENTRY
),
DummyDllW
,
DummyFunctionW
};
BOOL
ret
;
/* All NULL */
SetLastError
(
0xdeadbeef
);
ret
=
pWintrustAddActionID
(
NULL
,
0
,
NULL
);
ok
(
!
ret
,
"Expected WintrustAddActionID to fail.
\n
"
);
todo_wine
{
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
/* XP/W2K3 */
||
GetLastError
()
==
0xdeadbeef
/* Win98/NT4/W2K */
,
"Expected ERROR_INVALID_PARAMETER(W2K3) or 0xdeadbeef(Win98/NT4/W2K), got %ld.
\n
"
,
GetLastError
());
}
/* NULL functions */
SetLastError
(
0xdeadbeef
);
ret
=
pWintrustAddActionID
(
&
ActionID
,
0
,
NULL
);
ok
(
!
ret
,
"Expected WintrustAddActionID to fail.
\n
"
);
todo_wine
{
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
/* XP/W2K3 */
||
GetLastError
()
==
0xdeadbeef
/* Win98/NT4/W2K */
,
"Expected ERROR_INVALID_PARAMETER(W2K3) or 0xdeadbeef(Win98/NT4/W2K), got %ld.
\n
"
,
GetLastError
());
}
/* All OK (although no functions defined), except cbStruct is not set in ActionIDFunctions */
SetLastError
(
0xdeadbeef
);
memset
(
&
ActionIDFunctions
,
0
,
sizeof
(
CRYPT_REGISTER_ACTIONID
));
ret
=
pWintrustAddActionID
(
&
ActionID
,
0
,
&
ActionIDFunctions
);
ok
(
!
ret
,
"Expected WintrustAddActionID to fail.
\n
"
);
todo_wine
{
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
/* XP/W2K3 */
||
GetLastError
()
==
0xdeadbeef
/* Win98/NT4/W2K */
,
"Expected ERROR_INVALID_PARAMETER(W2K3) or 0xdeadbeef(Win98/NT4/W2K), got %ld.
\n
"
,
GetLastError
());
}
/* All OK (although no functions defined) and cbStruct is set now */
SetLastError
(
0xdeadbeef
);
memset
(
&
ActionIDFunctions
,
0
,
sizeof
(
CRYPT_REGISTER_ACTIONID
));
ActionIDFunctions
.
cbStruct
=
sizeof
(
CRYPT_REGISTER_ACTIONID
);
ret
=
pWintrustAddActionID
(
&
ActionID
,
0
,
&
ActionIDFunctions
);
todo_wine
{
ok
(
ret
,
"Expected WintrustAddActionID to succeed.
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
/* W2K */
,
"Expected ERROR_INVALID_PARAMETER, got %ld.
\n
"
,
GetLastError
());
}
/* All OK and all (but 1) functions are correctly defined. The DLL and entrypoints
* are not present.
*/
memset
(
&
ActionIDFunctions
,
0
,
sizeof
(
CRYPT_REGISTER_ACTIONID
));
ActionIDFunctions
.
cbStruct
=
sizeof
(
CRYPT_REGISTER_ACTIONID
);
ActionIDFunctions
.
sInitProvider
=
DummyProvider
;
ActionIDFunctions
.
sObjectProvider
=
DummyProvider
;
ActionIDFunctions
.
sSignatureProvider
=
EmptyProvider
;
ActionIDFunctions
.
sCertificateProvider
=
DummyProvider
;
ActionIDFunctions
.
sCertificatePolicyProvider
=
DummyProvider
;
ActionIDFunctions
.
sFinalPolicyProvider
=
DummyProvider
;
ActionIDFunctions
.
sTestPolicyProvider
=
DummyProvider
;
ActionIDFunctions
.
sCleanupProvider
=
DummyProvider
;
SetLastError
(
0xdeadbeef
);
ret
=
pWintrustAddActionID
(
&
ActionID
,
0
,
&
ActionIDFunctions
);
todo_wine
{
ok
(
ret
,
"Expected WintrustAddActionID to succeed.
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
/* W2K */
,
"Expected ERROR_INVALID_PARAMETER, got %ld.
\n
"
,
GetLastError
());
}
/* All OK and all functions are correctly defined. The DLL and entrypoints
* are not present.
*/
memset
(
&
ActionIDFunctions
,
0
,
sizeof
(
CRYPT_REGISTER_ACTIONID
));
ActionIDFunctions
.
cbStruct
=
sizeof
(
CRYPT_REGISTER_ACTIONID
);
ActionIDFunctions
.
sInitProvider
=
DummyProvider
;
ActionIDFunctions
.
sObjectProvider
=
DummyProvider
;
ActionIDFunctions
.
sSignatureProvider
=
DummyProvider
;
ActionIDFunctions
.
sCertificateProvider
=
DummyProvider
;
ActionIDFunctions
.
sCertificatePolicyProvider
=
DummyProvider
;
ActionIDFunctions
.
sFinalPolicyProvider
=
DummyProvider
;
ActionIDFunctions
.
sTestPolicyProvider
=
DummyProvider
;
ActionIDFunctions
.
sCleanupProvider
=
DummyProvider
;
SetLastError
(
0xdeadbeef
);
ret
=
pWintrustAddActionID
(
&
ActionID
,
0
,
&
ActionIDFunctions
);
todo_wine
{
ok
(
ret
,
"Expected WintrustAddActionID to succeed.
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
/* W2K */
,
"Expected 0xdeadbeef, got %ld.
\n
"
,
GetLastError
());
}
SetLastError
(
0xdeadbeef
);
ret
=
pWintrustRemoveActionID
(
&
ActionID
);
todo_wine
{
ok
(
ret
,
"WintrustRemoveActionID failed : 0x%08lx
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0xdeadbeef
,
"Last error should not have been changed: 0x%08lx
\n
"
,
GetLastError
());
}
}
START_TEST
(
register
)
{
if
(
!
InitFunctionPtrs
())
return
;
test_AddRem_ActionID
();
FreeLibrary
(
hWintrust
);
}
programs/winetest/Makefile.in
View file @
95bb9032
...
...
@@ -74,6 +74,7 @@ TESTBINS = \
wininet_test.exe
$(DLLEXT)
\
winmm_test.exe
$(DLLEXT)
\
winspool.drv_test.exe
$(DLLEXT)
\
wintrust_test.exe
$(DLLEXT)
\
ws2_32_test.exe
$(DLLEXT)
advapi32_test.exe$(DLLEXT)
:
$(DLLDIR)/advapi32/tests/advapi32_test.exe$(DLLEXT)
...
...
@@ -178,6 +179,8 @@ winmm_test.exe$(DLLEXT): $(DLLDIR)/winmm/tests/winmm_test.exe$(DLLEXT)
cp
$(DLLDIR)
/winmm/tests/winmm_test.exe
$(DLLEXT)
$@
&&
$(STRIP)
$@
winspool.drv_test.exe$(DLLEXT)
:
$(DLLDIR)/winspool.drv/tests/winspool.drv_test.exe$(DLLEXT)
cp
$(DLLDIR)
/winspool.drv/tests/winspool.drv_test.exe
$(DLLEXT)
$@
&&
$(STRIP)
$@
wintrust_test.exe$(DLLEXT)
:
$(DLLDIR)/wintrust/tests/wintrust_test.exe$(DLLEXT)
cp
$(DLLDIR)
/wintrust/tests/wintrust_test.exe
$(DLLEXT)
$@
&&
$(STRIP)
$@
ws2_32_test.exe$(DLLEXT)
:
$(DLLDIR)/ws2_32/tests/ws2_32_test.exe$(DLLEXT)
cp
$(DLLDIR)
/ws2_32/tests/ws2_32_test.exe
$(DLLEXT)
$@
&&
$(STRIP)
$@
...
...
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