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
9be7a60d
Commit
9be7a60d
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: Change test_RegPolicyFlags to use the same logic as the rest of the tests.
parent
c16830db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
register.c
dlls/wintrust/tests/register.c
+15
-14
No files found.
dlls/wintrust/tests/register.c
View file @
9be7a60d
...
...
@@ -30,14 +30,14 @@
static
BOOL
(
WINAPI
*
pWintrustAddActionID
)(
GUID
*
,
DWORD
,
CRYPT_REGISTER_ACTIONID
*
);
static
BOOL
(
WINAPI
*
pWintrustAddDefaultForUsage
)(
const
CHAR
*
,
CRYPT_PROVIDER_REGDEFUSAGE
*
);
static
BOOL
(
WINAPI
*
pWintrustRemoveActionID
)(
GUID
*
);
static
void
(
WINAPI
*
pWintrustGetRegPolicyFlags
)(
DWORD
*
);
static
BOOL
(
WINAPI
*
pWintrustLoadFunctionPointers
)(
GUID
*
,
CRYPT_PROVIDER_FUNCTIONS
*
);
static
HMODULE
hWintrust
=
0
;
static
BOOL
(
WINAPI
*
pWintrustRemoveActionID
)(
GUID
*
);
static
BOOL
(
WINAPI
*
pWintrustSetRegPolicyFlags
)(
DWORD
)
;
static
void
InitFunctionPtrs
(
void
)
{
hWintrust
=
GetModuleHandleA
(
"wintrust.dll"
);
HMODULE
hWintrust
=
GetModuleHandleA
(
"wintrust.dll"
);
#define WINTRUST_GET_PROC(func) \
p ## func = (void*)GetProcAddress(hWintrust, #func); \
...
...
@@ -46,8 +46,10 @@ static void InitFunctionPtrs(void)
WINTRUST_GET_PROC
(
WintrustAddActionID
)
WINTRUST_GET_PROC
(
WintrustAddDefaultForUsage
)
WINTRUST_GET_PROC
(
Wintrust
RemoveActionID
)
WINTRUST_GET_PROC
(
Wintrust
GetRegPolicyFlags
)
WINTRUST_GET_PROC
(
WintrustLoadFunctionPointers
)
WINTRUST_GET_PROC
(
WintrustRemoveActionID
)
WINTRUST_GET_PROC
(
WintrustSetRegPolicyFlags
)
#undef WINTRUST_GET_PROC
}
...
...
@@ -309,19 +311,18 @@ static void test_RegPolicyFlags(void)
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Wintrust
\\
"
"Trust Providers
\\
Software Publishing"
;
static
const
CHAR
State
[]
=
"State"
;
void
(
WINAPI
*
pGetFlags
)(
DWORD
*
);
BOOL
(
WINAPI
*
pSetFlags
)(
DWORD
);
HKEY
key
;
LONG
r
;
DWORD
flags1
,
flags2
,
flags3
,
size
;
BOOL
ret
;
pGetFlags
=
(
void
*
)
GetProcAddress
(
hWintrust
,
"WintrustGetRegPolicyFlags"
);
pSetFlags
=
(
void
*
)
GetProcAddress
(
hWintrust
,
"WintrustSetRegPolicyFlags"
);
if
(
!
pGetFlags
||
!
pSetFlags
)
if
(
!
pWintrustGetRegPolicyFlags
||
!
pWintrustSetRegPolicyFlags
)
{
skip
(
"Policy flags functions not present
\n
"
);
return
;
}
p
Get
Flags
(
&
flags2
);
p
WintrustGetRegPolicy
Flags
(
&
flags2
);
r
=
RegOpenKeyExA
(
HKEY_CURRENT_USER
,
Software_Publishing
,
0
,
KEY_ALL_ACCESS
,
&
key
);
...
...
@@ -334,13 +335,13 @@ static void test_RegPolicyFlags(void)
ok
(
flags1
==
flags2
,
"Got %08x flags instead of %08x
\n
"
,
flags1
,
flags2
);
flags3
=
flags2
|
1
;
ret
=
p
Set
Flags
(
flags3
);
ok
(
ret
,
"
pSet
Flags failed: %d
\n
"
,
GetLastError
());
ret
=
p
WintrustSetRegPolicy
Flags
(
flags3
);
ok
(
ret
,
"
WintrustSetRegPolicy
Flags failed: %d
\n
"
,
GetLastError
());
size
=
sizeof
(
flags1
);
r
=
RegQueryValueExA
(
key
,
State
,
NULL
,
NULL
,
(
LPBYTE
)
&
flags1
,
&
size
);
ok
(
flags1
==
flags3
,
"Got %08x flags instead of %08x
\n
"
,
flags1
,
flags3
);
p
Set
Flags
(
flags2
);
p
WintrustSetRegPolicy
Flags
(
flags2
);
RegCloseKey
(
key
);
}
...
...
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