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
d685894a
Commit
d685894a
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/tests: Add tests for CredIsMarshaledCredential.
parent
d96de830
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
cred.c
dlls/advapi32/tests/cred.c
+64
-0
No files found.
dlls/advapi32/tests/cred.c
View file @
d685894a
...
...
@@ -37,6 +37,7 @@ static BOOL (WINAPI *pCredWriteA)(PCREDENTIALA,DWORD);
static
BOOL
(
WINAPI
*
pCredReadDomainCredentialsA
)(
PCREDENTIAL_TARGET_INFORMATIONA
,
DWORD
,
DWORD
*
,
PCREDENTIALA
**
);
static
BOOL
(
WINAPI
*
pCredMarshalCredentialA
)(
CRED_MARSHAL_TYPE
,
PVOID
,
LPSTR
*
);
static
BOOL
(
WINAPI
*
pCredUnmarshalCredentialA
)(
LPCSTR
,
PCRED_MARSHAL_TYPE
,
PVOID
);
static
BOOL
(
WINAPI
*
pCredIsMarshaledCredentialA
)(
LPCSTR
);
#define TEST_TARGET_NAME "credtest.winehq.org"
#define TEST_TARGET_NAME2 "credtest2.winehq.org"
...
...
@@ -630,6 +631,67 @@ static void test_CredUnmarshalCredentialA(void)
pCredFree
(
username
);
}
static
void
test_CredIsMarshaledCredentialA
(
void
)
{
int
i
;
BOOL
res
;
BOOL
expected
=
TRUE
;
const
char
*
ptr
[]
=
{
/* CertCredential */
"@@BXlmblBAAAAAAAAAAAAAAAAAAAAA"
,
/* hash for 'W','i','n','e' */
"@@BAAAAAAAAAAAAAAAAAAAAAAAAAAA"
,
/* hash for all 0 */
/* UsernameTargetCredential */
"@@CCAAAAA0BA"
,
/* "t" */
"@@CIAAAAA0BQZAMHA0BA"
,
/* "test" */
/* todo: BinaryBlobCredential */
/* not marshaled names return always FALSE */
"winetest"
,
""
,
"@@"
,
"@@A"
,
"@@AA"
,
"@@AAA"
,
"@@B"
,
"@@BB"
,
"@@BBB"
,
/* CertCredential */
"@@BAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
,
/* to long */
"@@BAAAAAAAAAAAAAAAAAAAAAAAAAA"
,
/* to short */
"@@BAAAAAAAAAAAAAAAAAAAAAAAAAA+"
,
/* bad char */
"@@BAAAAAAAAAAAAAAAAAAAAAAAAAA:"
,
"@@BAAAAAAAAAAAAAAAAAAAAAAAAAA>"
,
"@@BAAAAAAAAAAAAAAAAAAAAAAAAAA<"
,
"@@C"
,
"@@CC"
,
"@@CCC"
,
"@@D"
,
"@@DD"
,
"@@DDD"
,
NULL
};
for
(
i
=
0
;
ptr
[
i
];
i
++
)
{
if
(
*
ptr
[
i
]
!=
'@'
)
expected
=
FALSE
;
SetLastError
(
0xdeadbeef
);
res
=
pCredIsMarshaledCredentialA
(
ptr
[
i
]);
if
(
expected
)
ok
(
res
!=
FALSE
,
"%d: got %d and %u for %s (expected TRUE)
\n
"
,
i
,
res
,
GetLastError
(),
ptr
[
i
]);
else
{
/* Windows returns ERROR_INVALID_PARAMETER here, but that's not documented */
ok
(
!
res
,
"%d: got %d and %u for %s (expected FALSE)
\n
"
,
i
,
res
,
GetLastError
(),
ptr
[
i
]);
}
}
}
START_TEST
(
cred
)
{
DWORD
persists
[
CRED_TYPE_MAXIMUM
];
...
...
@@ -644,6 +706,7 @@ START_TEST(cred)
pCredReadDomainCredentialsA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredReadDomainCredentialsA"
);
pCredMarshalCredentialA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredMarshalCredentialA"
);
pCredUnmarshalCredentialA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredUnmarshalCredentialA"
);
pCredIsMarshaledCredentialA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredIsMarshaledCredentialA"
);
if
(
!
pCredEnumerateA
||
!
pCredFree
||
!
pCredWriteA
||
!
pCredDeleteA
||
!
pCredReadA
)
{
...
...
@@ -690,4 +753,5 @@ START_TEST(cred)
test_CredMarshalCredentialA
();
test_CredUnmarshalCredentialA
();
test_CredIsMarshaledCredentialA
();
}
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