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
d3b0543c
Commit
d3b0543c
authored
Feb 11, 2014
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Feb 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32/tests: Use common wine_dbgstr_guid implementation from test.h.
parent
374b449f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
21 deletions
+9
-21
sip.c
dlls/crypt32/tests/sip.c
+9
-21
No files found.
dlls/crypt32/tests/sip.c
View file @
d3b0543c
...
...
@@ -36,17 +36,6 @@ static BOOL (WINAPI * funcCryptSIPCreateIndirectData)(SIP_SUBJECTINFO *,DWORD *,
static
BOOL
(
WINAPI
*
funcCryptSIPVerifyIndirectData
)(
SIP_SUBJECTINFO
*
,
SIP_INDIRECT_DATA
*
);
static
BOOL
(
WINAPI
*
funcCryptSIPRemoveSignedDataMsg
)(
SIP_SUBJECTINFO
*
,
DWORD
);
static
char
*
show_guid
(
const
GUID
*
guid
,
char
*
buf
)
{
sprintf
(
buf
,
"{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]
);
return
buf
;
}
static
void
test_AddRemoveProvider
(
void
)
{
BOOL
ret
;
...
...
@@ -165,7 +154,6 @@ static void test_SIPRetrieveSubjectGUID(void)
static
CHAR
path
[
MAX_PATH
];
static
CHAR
tempfile
[
MAX_PATH
];
static
WCHAR
tempfileW
[
MAX_PATH
];
static
char
guid1
[
39
],
guid2
[
39
];
DWORD
written
;
/* NULL check */
...
...
@@ -186,7 +174,7 @@ static void test_SIPRetrieveSubjectGUID(void)
"Expected ERROR_FILE_NOT_FOUND or ERROR_PATH_NOT_FOUND, got %d.
\n
"
,
GetLastError
());
ok
(
!
memcmp
(
&
subject
,
&
nullSubject
,
sizeof
(
GUID
)),
"Expected a NULL GUID for c:
\\
deadbeef.dbf, not %s
\n
"
,
show_guid
(
&
subject
,
guid1
));
"Expected a NULL GUID for c:
\\
deadbeef.dbf, not %s
\n
"
,
wine_dbgstr_guid
(
&
subject
));
/* Now with an executable that should exist
*
...
...
@@ -205,7 +193,7 @@ static void test_SIPRetrieveSubjectGUID(void)
ret
=
CryptSIPRetrieveSubjectGuid
(
regeditPathW
,
NULL
,
&
subject
);
ok
(
ret
,
"Expected CryptSIPRetrieveSubjectGuid to succeed
\n
"
);
ok
(
!
memcmp
(
&
subject
,
&
unknownGUID
,
sizeof
(
GUID
)),
"Expected (%s), got (%s).
\n
"
,
show_guid
(
&
unknownGUID
,
guid1
),
show_guid
(
&
subject
,
guid2
));
"Expected (%s), got (%s).
\n
"
,
wine_dbgstr_guid
(
&
unknownGUID
),
wine_dbgstr_guid
(
&
subject
));
/* The same thing but now with a handle instead of a filename */
file
=
CreateFileA
(
regeditPath
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
...
...
@@ -214,7 +202,7 @@ static void test_SIPRetrieveSubjectGUID(void)
ret
=
CryptSIPRetrieveSubjectGuid
(
NULL
,
file
,
&
subject
);
ok
(
ret
,
"Expected CryptSIPRetrieveSubjectGuid to succeed
\n
"
);
ok
(
!
memcmp
(
&
subject
,
&
unknownGUID
,
sizeof
(
GUID
)),
"Expected (%s), got (%s).
\n
"
,
show_guid
(
&
unknownGUID
,
guid1
),
show_guid
(
&
subject
,
guid2
));
"Expected (%s), got (%s).
\n
"
,
wine_dbgstr_guid
(
&
unknownGUID
),
wine_dbgstr_guid
(
&
subject
));
CloseHandle
(
file
);
/* And both */
...
...
@@ -224,7 +212,7 @@ static void test_SIPRetrieveSubjectGUID(void)
ret
=
CryptSIPRetrieveSubjectGuid
(
regeditPathW
,
file
,
&
subject
);
ok
(
ret
,
"Expected CryptSIPRetrieveSubjectGuid to succeed
\n
"
);
ok
(
!
memcmp
(
&
subject
,
&
unknownGUID
,
sizeof
(
GUID
)),
"Expected (%s), got (%s).
\n
"
,
show_guid
(
&
unknownGUID
,
guid1
),
show_guid
(
&
subject
,
guid2
));
"Expected (%s), got (%s).
\n
"
,
wine_dbgstr_guid
(
&
unknownGUID
),
wine_dbgstr_guid
(
&
subject
));
CloseHandle
(
file
);
/* Now with an empty file */
...
...
@@ -244,7 +232,7 @@ static void test_SIPRetrieveSubjectGUID(void)
GetLastError
()
==
TRUST_E_SUBJECT_FORM_UNKNOWN
/* some Win98 */
,
"Expected ERROR_FILE_INVALID, ERROR_INVALID_PARAMETER, ERROR_SUCCESS or TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08x
\n
"
,
GetLastError
());
ok
(
!
memcmp
(
&
subject
,
&
nullSubject
,
sizeof
(
GUID
)),
"Expected a NULL GUID for empty file %s, not %s
\n
"
,
tempfile
,
show_guid
(
&
subject
,
guid1
));
"Expected a NULL GUID for empty file %s, not %s
\n
"
,
tempfile
,
wine_dbgstr_guid
(
&
subject
));
/* Use a file with a size of 3 (at least < 4) */
file
=
CreateFileA
(
tempfile
,
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
...
...
@@ -260,7 +248,7 @@ static void test_SIPRetrieveSubjectGUID(void)
GetLastError
()
==
TRUST_E_SUBJECT_FORM_UNKNOWN
/* some Win98 */
,
"Expected ERROR_INVALID_PARAMETER, ERROR_SUCCESS or TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08x
\n
"
,
GetLastError
());
ok
(
!
memcmp
(
&
subject
,
&
nullSubject
,
sizeof
(
GUID
)),
"Expected a NULL GUID for empty file %s, not %s
\n
"
,
tempfile
,
show_guid
(
&
subject
,
guid1
));
"Expected a NULL GUID for empty file %s, not %s
\n
"
,
tempfile
,
wine_dbgstr_guid
(
&
subject
));
/* And now >= 4 */
file
=
CreateFileA
(
tempfile
,
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
...
...
@@ -275,7 +263,7 @@ static void test_SIPRetrieveSubjectGUID(void)
GetLastError
()
==
ERROR_SUCCESS
/* Win98 */
,
"Expected TRUST_E_SUBJECT_FORM_UNKNOWN or ERROR_SUCCESS, got 0x%08x
\n
"
,
GetLastError
());
ok
(
!
memcmp
(
&
subject
,
&
nullSubject
,
sizeof
(
GUID
)),
"Expected a NULL GUID for empty file %s, not %s
\n
"
,
tempfile
,
show_guid
(
&
subject
,
guid1
));
"Expected a NULL GUID for empty file %s, not %s
\n
"
,
tempfile
,
wine_dbgstr_guid
(
&
subject
));
/* Clean up */
DeleteFileA
(
tempfile
);
...
...
@@ -293,7 +281,7 @@ static void test_SIPRetrieveSubjectGUID(void)
ok
(
ret
,
"CryptSIPRetrieveSubjectGuid failed: %d (0x%08x)
\n
"
,
GetLastError
(),
GetLastError
()
);
ok
(
!
memcmp
(
&
subject
,
&
cabGUID
,
sizeof
(
GUID
)),
"Expected GUID %s for cabinet file, not %s
\n
"
,
show_guid
(
&
cabGUID
,
guid1
),
show_guid
(
&
subject
,
guid2
));
"Expected GUID %s for cabinet file, not %s
\n
"
,
wine_dbgstr_guid
(
&
cabGUID
),
wine_dbgstr_guid
(
&
subject
));
/* Clean up */
DeleteFileA
(
tempfile
);
...
...
@@ -311,7 +299,7 @@ static void test_SIPRetrieveSubjectGUID(void)
ok
(
ret
,
"CryptSIPRetrieveSubjectGuid failed: %d (0x%08x)
\n
"
,
GetLastError
(),
GetLastError
()
);
ok
(
!
memcmp
(
&
subject
,
&
cabGUID
,
sizeof
(
GUID
)),
"Expected GUID %s for cabinet file, not %s
\n
"
,
show_guid
(
&
cabGUID
,
guid1
),
show_guid
(
&
subject
,
guid2
));
"Expected GUID %s for cabinet file, not %s
\n
"
,
wine_dbgstr_guid
(
&
cabGUID
),
wine_dbgstr_guid
(
&
subject
));
/* Clean up */
DeleteFileA
(
tempfile
);
...
...
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