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
16d91233
Commit
16d91233
authored
Aug 14, 2007
by
Paul Vriens
Committed by
Alexandre Julliard
Aug 15, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32/tests: Use GetModuleHandle and skip.
parent
714a3731
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
28 deletions
+34
-28
main.c
dlls/crypt32/tests/main.c
+2
-9
sip.c
dlls/crypt32/tests/sip.c
+6
-11
str.c
dlls/crypt32/tests/str.c
+26
-8
No files found.
dlls/crypt32/tests/main.c
View file @
16d91233
...
...
@@ -225,8 +225,6 @@ static void test_cryptTls(void)
DWORD
index
;
BOOL
ret
;
if
(
!
hCrypt
)
return
;
pI_CryptAllocTls
=
(
I_CryptAllocTlsFunc
)
GetProcAddress
(
hCrypt
,
"I_CryptAllocTls"
);
pI_CryptDetachTls
=
(
I_CryptDetachTlsFunc
)
GetProcAddress
(
hCrypt
,
...
...
@@ -290,8 +288,6 @@ static void test_readTrustedPublisherDWORD(void)
{
I_CryptReadTrustedPublisherDWORDValueFromRegistryFunc
pReadDWORD
;
if
(
!
hCrypt
)
return
;
pReadDWORD
=
(
I_CryptReadTrustedPublisherDWORDValueFromRegistryFunc
)
GetProcAddress
(
hCrypt
,
"I_CryptReadTrustedPublisherDWORDValueFromRegistry"
);
...
...
@@ -335,8 +331,6 @@ static void test_getDefaultCryptProv(void)
I_CryptGetDefaultCryptProvFunc
pI_CryptGetDefaultCryptProv
;
HCRYPTPROV
prov
;
if
(
!
hCrypt
)
return
;
pI_CryptGetDefaultCryptProv
=
(
I_CryptGetDefaultCryptProvFunc
)
GetProcAddress
(
hCrypt
,
"I_CryptGetDefaultCryptProv"
);
if
(
!
pI_CryptGetDefaultCryptProv
)
return
;
...
...
@@ -362,8 +356,6 @@ static void test_CryptInstallOssGlobal(void)
int
ret
,
i
;
I_CryptInstallOssGlobal
pI_CryptInstallOssGlobal
;
if
(
!
hCrypt
)
return
;
pI_CryptInstallOssGlobal
=
(
I_CryptInstallOssGlobal
)
GetProcAddress
(
hCrypt
,
"I_CryptInstallOssGlobal"
);
/* passing in some random values to I_CryptInstallOssGlobal, it always returns 9 the first time, then 10, 11 etc.*/
for
(
i
=
0
;
i
<
30
;
i
++
)
...
...
@@ -375,7 +367,8 @@ static void test_CryptInstallOssGlobal(void)
START_TEST
(
main
)
{
hCrypt
=
LoadLibraryA
(
"crypt32.dll"
);
hCrypt
=
GetModuleHandleA
(
"crypt32.dll"
);
test_findAttribute
();
test_findExtension
();
test_findRDNAttr
();
...
...
dlls/crypt32/tests/sip.c
View file @
16d91233
...
...
@@ -295,17 +295,12 @@ static void test_SIPLoad(void)
"Expected TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08x
\n
"
,
GetLastError
());
ok
(
sdi
.
pfGet
==
(
pCryptSIPGetSignedDataMsg
)
0xdeadbeef
,
"Expected no change to the function pointer
\n
"
);
hCrypt
=
LoadLibraryA
(
"crypt32.dll"
);
if
(
hCrypt
)
{
funcCryptSIPGetSignedDataMsg
=
(
void
*
)
GetProcAddress
(
hCrypt
,
"CryptSIPGetSignedDataMsg"
);
funcCryptSIPPutSignedDataMsg
=
(
void
*
)
GetProcAddress
(
hCrypt
,
"CryptSIPPutSignedDataMsg"
);
funcCryptSIPCreateIndirectData
=
(
void
*
)
GetProcAddress
(
hCrypt
,
"CryptSIPCreateIndirectData"
);
funcCryptSIPVerifyIndirectData
=
(
void
*
)
GetProcAddress
(
hCrypt
,
"CryptSIPVerifyIndirectData"
);
funcCryptSIPRemoveSignedDataMsg
=
(
void
*
)
GetProcAddress
(
hCrypt
,
"CryptSIPRemoveSignedDataMsg"
);
}
/* We're not going to use the functions, so we can free already here */
FreeLibrary
(
hCrypt
);
hCrypt
=
GetModuleHandleA
(
"crypt32.dll"
);
funcCryptSIPGetSignedDataMsg
=
(
void
*
)
GetProcAddress
(
hCrypt
,
"CryptSIPGetSignedDataMsg"
);
funcCryptSIPPutSignedDataMsg
=
(
void
*
)
GetProcAddress
(
hCrypt
,
"CryptSIPPutSignedDataMsg"
);
funcCryptSIPCreateIndirectData
=
(
void
*
)
GetProcAddress
(
hCrypt
,
"CryptSIPCreateIndirectData"
);
funcCryptSIPVerifyIndirectData
=
(
void
*
)
GetProcAddress
(
hCrypt
,
"CryptSIPVerifyIndirectData"
);
funcCryptSIPRemoveSignedDataMsg
=
(
void
*
)
GetProcAddress
(
hCrypt
,
"CryptSIPRemoveSignedDataMsg"
);
/* All OK */
SetLastError
(
0xdeadbeef
);
...
...
dlls/crypt32/tests/str.c
View file @
16d91233
...
...
@@ -271,7 +271,11 @@ static void test_CertRDNValueToStrW(void)
WCHAR
buffer
[
2000
];
CERT_RDN_VALUE_BLOB
blob
=
{
0
,
NULL
};
if
(
!
pCertRDNValueToStrW
)
return
;
if
(
!
pCertRDNValueToStrW
)
{
skip
(
"CertRDNValueToStrW is not available
\n
"
);
return
;
}
/* This crashes
ret = pCertRDNValueToStrW(0, NULL, NULL, 0);
...
...
@@ -319,7 +323,11 @@ static void test_CertNameToStrA(void)
{
PCCERT_CONTEXT
context
;
if
(
!
pCertNameToStrA
)
return
;
if
(
!
pCertNameToStrA
)
{
skip
(
"CertNameToStrA is not available
\n
"
);
return
;
}
context
=
CertCreateCertificateContext
(
X509_ASN_ENCODING
,
cert
,
sizeof
(
cert
));
...
...
@@ -392,7 +400,11 @@ static void test_CertNameToStrW(void)
{
PCCERT_CONTEXT
context
;
if
(
!
pCertNameToStrW
)
return
;
if
(
!
pCertNameToStrW
)
{
skip
(
"CertNameToStrW is not available
\n
"
);
return
;
}
context
=
CertCreateCertificateContext
(
X509_ASN_ENCODING
,
cert
,
sizeof
(
cert
));
...
...
@@ -473,7 +485,11 @@ static void test_CertStrToNameA(void)
DWORD
size
,
i
;
BYTE
buf
[
100
];
if
(
!
pCertStrToNameA
)
return
;
if
(
!
pCertStrToNameA
)
{
skip
(
"CertStrToNameA is not available
\n
"
);
return
;
}
/* Crash
ret = pCertStrToNameA(0, NULL, 0, NULL, NULL, NULL, NULL);
...
...
@@ -554,7 +570,11 @@ static void test_CertStrToNameW(void)
LPCWSTR
errorPtr
;
BYTE
buf
[
100
];
if
(
!
pCertStrToNameW
)
return
;
if
(
!
pCertStrToNameW
)
{
skip
(
"CertStrToNameW is not available
\n
"
);
return
;
}
/* Crash
ret = pCertStrToNameW(0, NULL, 0, NULL, NULL, NULL, NULL);
...
...
@@ -600,7 +620,7 @@ static void test_CertStrToNameW(void)
START_TEST
(
str
)
{
dll
=
LoadLibrary
(
"Crypt32.dll"
);
dll
=
GetModuleHandleA
(
"Crypt32.dll"
);
pCertNameToStrA
=
(
CertNameToStrAFunc
)
GetProcAddress
(
dll
,
"CertNameToStrA"
);
pCertNameToStrW
=
(
CertNameToStrWFunc
)
GetProcAddress
(
dll
,
"CertNameToStrW"
);
...
...
@@ -619,6 +639,4 @@ START_TEST(str)
test_CertNameToStrW
();
test_CertStrToNameA
();
test_CertStrToNameW
();
FreeLibrary
(
dll
);
}
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