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
8c90767c
Commit
8c90767c
authored
Sep 30, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Oct 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintrust: Implement WTHelperGetKnownUsages.
parent
c4c409e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
10 deletions
+79
-10
softpub.c
dlls/wintrust/tests/softpub.c
+0
-8
wintrust_main.c
dlls/wintrust/wintrust_main.c
+79
-2
No files found.
dlls/wintrust/tests/softpub.c
View file @
8c90767c
...
...
@@ -479,17 +479,14 @@ static void test_get_known_usages(void)
}
SetLastError
(
0xdeadbeef
);
ret
=
pWTHelperGetKnownUsages
(
0
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pWTHelperGetKnownUsages
(
1
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pWTHelperGetKnownUsages
(
0
,
&
usages
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
/* A value of 1 for the first parameter seems to imply the value is
...
...
@@ -498,9 +495,7 @@ static void test_get_known_usages(void)
SetLastError
(
0xdeadbeef
);
usages
=
NULL
;
ret
=
pWTHelperGetKnownUsages
(
1
,
&
usages
);
todo_wine
ok
(
ret
,
"WTHelperGetKnownUsages failed: %d
\n
"
,
GetLastError
());
todo_wine
ok
(
usages
!=
NULL
,
"expected a pointer
\n
"
);
if
(
ret
&&
usages
)
{
...
...
@@ -523,17 +518,14 @@ static void test_get_known_usages(void)
*/
SetLastError
(
0xdeadbeef
);
ret
=
pWTHelperGetKnownUsages
(
2
,
&
usages
);
todo_wine
ok
(
ret
,
"WTHelperGetKnownUsages failed: %d
\n
"
,
GetLastError
());
ok
(
usages
==
NULL
,
"expected pointer to be cleared
\n
"
);
SetLastError
(
0xdeadbeef
);
usages
=
NULL
;
ret
=
pWTHelperGetKnownUsages
(
2
,
&
usages
);
todo_wine
ok
(
ret
,
"WTHelperGetKnownUsages failed: %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pWTHelperGetKnownUsages
(
2
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
}
...
...
dlls/wintrust/wintrust_main.c
View file @
8c90767c
...
...
@@ -735,13 +735,90 @@ HANDLE WINAPI WTHelperGetFileHandle(WINTRUST_DATA *data)
return
INVALID_HANDLE_VALUE
;
}
static
BOOL
WINAPI
WINTRUST_enumUsages
(
PCCRYPT_OID_INFO
pInfo
,
void
*
pvArg
)
{
PCCRYPT_OID_INFO
**
usages
=
(
PCCRYPT_OID_INFO
**
)
pvArg
;
DWORD
cUsages
;
BOOL
ret
;
if
(
!*
usages
)
{
cUsages
=
0
;
*
usages
=
WINTRUST_Alloc
(
2
*
sizeof
(
PCCRYPT_OID_INFO
));
}
else
{
PCCRYPT_OID_INFO
*
ptr
;
/* Count the existing usages.
* FIXME: make sure the new usage doesn't duplicate any in the list?
*/
for
(
cUsages
=
0
,
ptr
=
*
usages
;
*
ptr
;
ptr
++
,
cUsages
++
)
;
*
usages
=
WINTRUST_ReAlloc
((
CRYPT_OID_INFO
*
)
*
usages
,
(
cUsages
+
1
)
*
sizeof
(
PCCRYPT_OID_INFO
));
}
if
(
*
usages
)
{
(
*
usages
)[
cUsages
]
=
pInfo
;
(
*
usages
)[
cUsages
+
1
]
=
NULL
;
ret
=
TRUE
;
}
else
{
SetLastError
(
ERROR_OUTOFMEMORY
);
ret
=
FALSE
;
}
return
ret
;
}
/***********************************************************************
* WTHelperGetKnownUsages(WINTRUST.@)
*
* Enumerates the known enhanced key usages as an array of PCCRYPT_OID_INFOs.
*
* PARAMS
* action [In] 1 => allocate and return known usages, 2 => free previously
* allocated usages.
* usages [In/Out] If action == 1, *usages is set to an array of
* PCCRYPT_OID_INFO *. The array is terminated with a NULL
* pointer.
* If action == 2, *usages is freed.
*
* RETURNS
* TRUE on success, FALSE on failure.
*/
BOOL
WINAPI
WTHelperGetKnownUsages
(
DWORD
action
,
PCCRYPT_OID_INFO
**
usages
)
{
FIXME
(
"(%d, %p): stub
\n
"
,
action
,
usages
);
return
FALSE
;
BOOL
ret
;
TRACE
(
"(%d, %p)
\n
"
,
action
,
usages
);
if
(
!
usages
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
action
==
1
)
{
*
usages
=
NULL
;
ret
=
CryptEnumOIDInfo
(
CRYPT_ENHKEY_USAGE_OID_GROUP_ID
,
0
,
usages
,
WINTRUST_enumUsages
);
}
else
if
(
action
==
2
)
{
WINTRUST_Free
((
CRYPT_OID_INFO
*
)
*
usages
);
*
usages
=
NULL
;
ret
=
TRUE
;
}
else
{
WARN
(
"unknown action %d
\n
"
,
action
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
ret
=
FALSE
;
}
return
ret
;
}
static
const
WCHAR
Software_Publishing
[]
=
{
...
...
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