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
c16830db
Commit
c16830db
authored
Feb 11, 2008
by
Paul Vriens
Committed by
Alexandre Julliard
Feb 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintrust/tests: Use GetModuleHandleA instead of LoadLibraryA.
parent
ba90a740
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
20 deletions
+25
-20
register.c
dlls/wintrust/tests/register.c
+25
-20
No files found.
dlls/wintrust/tests/register.c
View file @
c16830db
...
...
@@ -35,30 +35,21 @@ static BOOL (WINAPI * pWintrustLoadFunctionPointers)(GUID *, CRYPT_PROVIDER_FUNC
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
)
static
void
InitFunctionPtrs
(
void
)
{
hWintrust
=
LoadLibrary
A
(
"wintrust.dll"
);
hWintrust
=
GetModuleHandle
A
(
"wintrust.dll"
);
if
(
!
hWintrust
)
{
trace
(
"Could not load wintrust.dll
\n
"
);
return
FALSE
;
}
#define WINTRUST_GET_PROC(func) \
p ## func = (void*)GetProcAddress(hWintrust, #func); \
if(!p ## func) \
trace("GetProcAddress(%s) failed\n", #func);
WINTRUST_GET_PROC
(
WintrustAddActionID
)
WINTRUST_GET_PROC
(
WintrustAddDefaultForUsage
)
WINTRUST_GET_PROC
(
WintrustRemoveActionID
)
WINTRUST_GET_PROC
(
WintrustLoadFunctionPointers
)
return
TRUE
;
#undef WINTRUST_GET_PROC
}
static
void
test_AddRem_ActionID
(
void
)
...
...
@@ -71,6 +62,12 @@ static void test_AddRem_ActionID(void)
CRYPT_TRUST_REG_ENTRY
DummyProvider
=
{
sizeof
(
CRYPT_TRUST_REG_ENTRY
),
DummyDllW
,
DummyFunctionW
};
BOOL
ret
;
if
(
!
pWintrustAddActionID
||
!
pWintrustRemoveActionID
)
{
skip
(
"WintrustAddActionID and/or WintrustRemoveActionID are not available
\n
"
);
return
;
}
/* All NULL */
SetLastError
(
0xdeadbeef
);
ret
=
pWintrustAddActionID
(
NULL
,
0
,
NULL
);
...
...
@@ -174,6 +171,12 @@ static void test_AddDefaultForUsage(void)
static
const
CHAR
Usages
[]
=
"SOFTWARE
\\
Microsoft
\\
Cryptography
\\
Providers
\\
Trust
\\
Usages
\\
1.2.3.4.5.6.7.8.9.10"
;
static
CRYPT_PROVIDER_REGDEFUSAGE
DefUsage
;
if
(
!
pWintrustAddDefaultForUsage
)
{
skip
(
"WintrustAddDefaultForUsage is not available
\n
"
);
return
;
}
/* All NULL */
SetLastError
(
0xdeadbeef
);
ret
=
pWintrustAddDefaultForUsage
(
NULL
,
NULL
);
...
...
@@ -264,6 +267,11 @@ static void test_LoadFunctionPointers(void)
CRYPT_PROVIDER_FUNCTIONS
funcs
;
GUID
action
=
WINTRUST_ACTION_GENERIC_VERIFY_V2
;
if
(
!
pWintrustLoadFunctionPointers
)
{
skip
(
"WintrustLoadFunctionPointers is not available
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
ret
=
pWintrustLoadFunctionPointers
(
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
0xdeadbeef
,
"Expected failure
\n
"
);
...
...
@@ -339,13 +347,10 @@ static void test_RegPolicyFlags(void)
START_TEST
(
register
)
{
if
(
!
InitFunctionPtrs
())
return
;
InitFunctionPtrs
();
test_AddRem_ActionID
();
test_AddDefaultForUsage
();
test_LoadFunctionPointers
();
test_RegPolicyFlags
();
FreeLibrary
(
hWintrust
);
}
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