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
94e4f593
Commit
94e4f593
authored
Aug 30, 2006
by
Paul Vriens
Committed by
Alexandre Julliard
Sep 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintrust: Implementation of WintrustRemoveActionID.
parent
a407da47
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
22 deletions
+79
-22
Makefile.in
dlls/wintrust/Makefile.in
+1
-1
register.c
dlls/wintrust/register.c
+70
-4
register.c
dlls/wintrust/tests/register.c
+8
-17
No files found.
dlls/wintrust/Makefile.in
View file @
94e4f593
...
...
@@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
wintrust.dll
IMPORTLIB
=
libwintrust.
$(IMPLIBEXT)
IMPORTS
=
crypt32 kernel32
IMPORTS
=
crypt32
user32 advapi32
kernel32
C_SRCS
=
\
register.c
\
...
...
dlls/wintrust/register.c
View file @
94e4f593
...
...
@@ -23,6 +23,8 @@
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winuser.h"
#include "winreg.h"
#include "guiddef.h"
#include "wintrust.h"
...
...
@@ -32,6 +34,22 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wintrust
);
static
const
WCHAR
Trust
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'C'
,
'r'
,
'y'
,
'p'
,
't'
,
'o'
,
'g'
,
'r'
,
'a'
,
'p'
,
'h'
,
'y'
,
'\\'
,
'P'
,
'r'
,
'o'
,
'v'
,
'i'
,
'd'
,
'e'
,
'r'
,
's'
,
'\\'
,
'T'
,
'r'
,
'u'
,
's'
,
't'
,
'\\'
,
0
};
static
const
WCHAR
Initialization
[]
=
{
'I'
,
'n'
,
'i'
,
't'
,
'i'
,
'a'
,
'l'
,
'i'
,
'z'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'\\'
,
0
};
static
const
WCHAR
Message
[]
=
{
'M'
,
'e'
,
's'
,
's'
,
'a'
,
'g'
,
'e'
,
'\\'
,
0
};
static
const
WCHAR
Signature
[]
=
{
'S'
,
'i'
,
'g'
,
'n'
,
'a'
,
't'
,
'u'
,
'r'
,
'e'
,
'\\'
,
0
};
static
const
WCHAR
Certificate
[]
=
{
'C'
,
'e'
,
'r'
,
't'
,
'i'
,
'f'
,
'i'
,
'c'
,
'a'
,
't'
,
'e'
,
'\\'
,
0
};
static
const
WCHAR
CertCheck
[]
=
{
'C'
,
'e'
,
'r'
,
't'
,
'C'
,
'h'
,
'e'
,
'c'
,
'k'
,
'\\'
,
0
};
static
const
WCHAR
FinalPolicy
[]
=
{
'F'
,
'i'
,
'n'
,
'a'
,
'l'
,
'P'
,
'o'
,
'l'
,
'i'
,
'c'
,
'y'
,
'\\'
,
0
};
static
const
WCHAR
DiagnosticPolicy
[]
=
{
'D'
,
'i'
,
'a'
,
'g'
,
'n'
,
'o'
,
's'
,
't'
,
'i'
,
'c'
,
'P'
,
'o'
,
'l'
,
'i'
,
'c'
,
'y'
,
'\\'
,
0
};
static
const
WCHAR
Cleanup
[]
=
{
'C'
,
'l'
,
'e'
,
'a'
,
'n'
,
'u'
,
'p'
,
'\\'
,
0
};
/***********************************************************************
* WintrustAddActionID (WINTRUST.@)
*
...
...
@@ -49,7 +67,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wintrust);
* Failure: FALSE. (Use GetLastError() for more information)
*
* NOTES
* Adding
a Trust provider
is basically only adding relevant information
* Adding
definitions
is basically only adding relevant information
* to the registry. No verification takes place whether a DLL or it's
* entrypoints exist.
* Information in the registry will always be overwritten.
...
...
@@ -63,6 +81,27 @@ BOOL WINAPI WintrustAddActionID( GUID* pgActionID, DWORD fdwFlags,
}
/***********************************************************************
* WINTRUST_RemoveProviderFromReg (WINTRUST.@)
*
* Helper function for WintrustRemoveActionID
*
*/
static
void
WINTRUST_RemoveProviderFromReg
(
WCHAR
*
GuidString
,
const
WCHAR
*
FunctionType
)
{
WCHAR
ProvKey
[
MAX_PATH
];
/* Create the needed key string */
ProvKey
[
0
]
=
'\0'
;
lstrcatW
(
ProvKey
,
Trust
);
lstrcatW
(
ProvKey
,
FunctionType
);
lstrcatW
(
ProvKey
,
GuidString
);
/* We don't care about success or failure */
RegDeleteKeyW
(
HKEY_LOCAL_MACHINE
,
ProvKey
);
}
/***********************************************************************
* WintrustRemoveActionID (WINTRUST.@)
*
* Remove the definitions of the actions a Trust provider can perform
...
...
@@ -82,9 +121,36 @@ BOOL WINAPI WintrustAddActionID( GUID* pgActionID, DWORD fdwFlags,
*/
BOOL
WINAPI
WintrustRemoveActionID
(
GUID
*
pgActionID
)
{
FIXME
(
"(%s)
\n
"
,
debugstr_guid
(
pgActionID
));
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
static
const
WCHAR
wszFormat
[]
=
{
'{'
,
'%'
,
'0'
,
'8'
,
'l'
,
'X'
,
'-'
,
'%'
,
'0'
,
'4'
,
'X'
,
'-'
,
'%'
,
'0'
,
'4'
,
'X'
,
'-'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'-'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'%'
,
'0'
,
'2'
,
'X'
,
'}'
,
0
};
WCHAR
GuidString
[
39
];
TRACE
(
"(%s)
\n
"
,
debugstr_guid
(
pgActionID
));
if
(
!
pgActionID
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
TRUE
;
}
/* Create this string only once, instead of in the helper function */
wsprintfW
(
GuidString
,
wszFormat
,
pgActionID
->
Data1
,
pgActionID
->
Data2
,
pgActionID
->
Data3
,
pgActionID
->
Data4
[
0
],
pgActionID
->
Data4
[
1
],
pgActionID
->
Data4
[
2
],
pgActionID
->
Data4
[
3
],
pgActionID
->
Data4
[
4
],
pgActionID
->
Data4
[
5
],
pgActionID
->
Data4
[
6
],
pgActionID
->
Data4
[
7
]);
/* We don't care about success or failure */
WINTRUST_RemoveProviderFromReg
(
GuidString
,
Initialization
);
WINTRUST_RemoveProviderFromReg
(
GuidString
,
Message
);
WINTRUST_RemoveProviderFromReg
(
GuidString
,
Signature
);
WINTRUST_RemoveProviderFromReg
(
GuidString
,
Certificate
);
WINTRUST_RemoveProviderFromReg
(
GuidString
,
CertCheck
);
WINTRUST_RemoveProviderFromReg
(
GuidString
,
FinalPolicy
);
WINTRUST_RemoveProviderFromReg
(
GuidString
,
DiagnosticPolicy
);
WINTRUST_RemoveProviderFromReg
(
GuidString
,
Cleanup
);
return
TRUE
;
}
/***********************************************************************
...
...
dlls/wintrust/tests/register.c
View file @
94e4f593
...
...
@@ -158,31 +158,22 @@ static void test_AddRem_ActionID(void)
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
());
}
ok
(
ret
,
"WintrustRemoveActionID failed : 0x%08lx
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0xdeadbeef
,
"Last error should not have been changed: 0x%08lx
\n
"
,
GetLastError
());
/* NULL input */
SetLastError
(
0xdeadbeef
);
ret
=
pWintrustRemoveActionID
(
NULL
);
todo_wine
{
ok
(
ret
,
"Expected WintrustRemoveActionID to succeed.
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld.
\n
"
,
GetLastError
());
}
ok
(
ret
,
"Expected WintrustRemoveActionID to succeed.
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %ld.
\n
"
,
GetLastError
());
/* The passed GUID is removed by a previous call, so it's basically a test with a non-existent Trust provider */
SetLastError
(
0xdeadbeef
);
ret
=
pWintrustRemoveActionID
(
&
ActionID
);
todo_wine
{
ok
(
ret
,
"Expected WintrustRemoveActionID to succeed.
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld.
\n
"
,
GetLastError
());
}
ok
(
ret
,
"Expected WintrustRemoveActionID to succeed.
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got %ld.
\n
"
,
GetLastError
());
}
START_TEST
(
register
)
...
...
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