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
d96de830
Commit
d96de830
authored
Jul 07, 2012
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Jul 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Implement CredIsMarshaledCredentialA/W.
parent
1ca6cacd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
2 deletions
+71
-2
advapi32.spec
dlls/advapi32/advapi32.spec
+2
-2
cred.c
dlls/advapi32/cred.c
+66
-0
wincred.h
include/wincred.h
+3
-0
No files found.
dlls/advapi32/advapi32.spec
View file @
d96de830
...
...
@@ -144,8 +144,8 @@
@ stdcall CredGetSessionTypes(long ptr)
# @ stub CredGetTargetInfoA
# @ stub CredGetTargetInfoW
# @ stub CredIsMarshaledCredentialA
# @ stub CredIsMarshaledCredentialW
@ stdcall CredIsMarshaledCredentialA(str)
@ stdcall CredIsMarshaledCredentialW(wstr)
# @ stub CredIsProtectedA
# @ stub CredIsProtectedW
@ stdcall CredMarshalCredentialA(long ptr ptr)
...
...
dlls/advapi32/cred.c
View file @
d96de830
...
...
@@ -2161,3 +2161,69 @@ BOOL WINAPI CredUnmarshalCredentialW( LPCWSTR cred, PCRED_MARSHAL_TYPE type, PVO
}
return
TRUE
;
}
/******************************************************************************
* CredIsMarshaledCredentialW [ADVAPI32.@]
*
* Check, if the name parameter is a marshaled credential, hash or binary blob
*
* PARAMS
* name the name to check
*
* RETURNS
* TRUE: the name parameter is a marshaled credential, hash or binary blob
* FALSE: the name is a plain username
*/
BOOL
WINAPI
CredIsMarshaledCredentialW
(
LPCWSTR
name
)
{
TRACE
(
"(%s)
\n
"
,
debugstr_w
(
name
));
if
(
name
&&
name
[
0
]
==
'@'
&&
name
[
1
]
==
'@'
&&
name
[
2
]
>
'A'
&&
name
[
3
])
{
char
hash
[
CERT_HASH_LENGTH
+
2
];
int
len
=
strlenW
(
name
+
3
);
DWORD
size
;
if
((
name
[
2
]
-
'A'
)
==
CertCredential
&&
(
len
==
27
)
&&
cred_decode
(
name
+
3
,
len
,
hash
))
return
TRUE
;
if
(((
name
[
2
]
-
'A'
)
==
UsernameTargetCredential
)
&&
(
len
>=
9
)
&&
cred_decode
(
name
+
3
,
6
,
(
char
*
)
&
size
)
&&
size
)
return
TRUE
;
if
((
name
[
2
]
-
'A'
)
==
BinaryBlobCredential
)
FIXME
(
"BinaryBlobCredential not checked
\n
"
);
if
((
name
[
2
]
-
'A'
)
>
BinaryBlobCredential
)
TRACE
(
"unknown type: %d
\n
"
,
(
name
[
2
]
-
'A'
));
}
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
/******************************************************************************
* CredIsMarshaledCredentialA [ADVAPI32.@]
*
* See CredIsMarshaledCredentialW
*
*/
BOOL
WINAPI
CredIsMarshaledCredentialA
(
LPCSTR
name
)
{
LPWSTR
nameW
=
NULL
;
BOOL
res
;
int
len
;
TRACE
(
"(%s)
\n
"
,
debugstr_a
(
name
));
if
(
name
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
NULL
,
0
);
nameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
nameW
,
len
);
}
res
=
CredIsMarshaledCredentialW
(
nameW
);
HeapFree
(
GetProcessHeap
(),
0
,
nameW
);
return
res
;
}
include/wincred.h
View file @
d96de830
...
...
@@ -248,6 +248,9 @@ WINADVAPI BOOL WINAPI CredEnumerateW(LPCWSTR,DWORD,DWORD *,PCREDENTIALW **);
#define CredEnumerate WINELIB_NAME_AW(CredEnumerate)
WINADVAPI
VOID
WINAPI
CredFree
(
PVOID
);
WINADVAPI
BOOL
WINAPI
CredGetSessionTypes
(
DWORD
,
LPDWORD
);
WINADVAPI
BOOL
WINAPI
CredIsMarshaledCredentialA
(
LPCSTR
);
WINADVAPI
BOOL
WINAPI
CredIsMarshaledCredentialW
(
LPCWSTR
);
#define CredIsMarshaledCredential WINELIB_NAME_AW(CredIsMarshaledCredential)
WINADVAPI
BOOL
WINAPI
CredMarshalCredentialA
(
CRED_MARSHAL_TYPE
,
PVOID
,
LPSTR
*
);
WINADVAPI
BOOL
WINAPI
CredMarshalCredentialW
(
CRED_MARSHAL_TYPE
,
PVOID
,
LPWSTR
*
);
#define CredMarshalCredential WINELIB_NAME_AW(CredMarshalCredential)
...
...
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