cryptnet/tests: Use UrlCanonicalize to create a URL.

This commit is contained in:
Andrew Eikum 2010-10-11 11:17:26 -05:00 committed by Alexandre Julliard
parent 602d44a12c
commit 35f8d7397b
2 changed files with 6 additions and 13 deletions

View File

@ -1,5 +1,5 @@
TESTDLL = cryptnet.dll
IMPORTS = cryptnet crypt32
IMPORTS = cryptnet crypt32 shlwapi
C_SRCS = \
cryptnet.c

View File

@ -24,6 +24,7 @@
#include <winbase.h>
#include <winerror.h>
#include <wincrypt.h>
#include <shlwapi.h>
#include "wine/test.h"
static const BYTE bigCert[] = {
@ -316,13 +317,14 @@ static void make_tmp_file(LPSTR path)
static void test_retrieveObjectByUrl(void)
{
BOOL ret;
char tmpfile[MAX_PATH * 2], *ptr, url[MAX_PATH + 8];
char tmpfile[MAX_PATH * 2], url[MAX_PATH + 8];
CRYPT_BLOB_ARRAY *pBlobArray;
PCCERT_CONTEXT cert;
PCCRL_CONTEXT crl;
HCERTSTORE store;
CRYPT_RETRIEVE_AUX_INFO aux = { 0 };
FILETIME ft = { 0 };
DWORD urllen;
SetLastError(0xdeadbeef);
ret = CryptRetrieveObjectByUrlA(NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL);
@ -332,17 +334,8 @@ static void test_retrieveObjectByUrl(void)
GetLastError(), GetLastError());
make_tmp_file(tmpfile);
ptr = strchr(tmpfile, ':');
if (ptr)
ptr += 2; /* skip colon and first slash */
else
ptr = tmpfile;
snprintf(url, sizeof(url), "file:///%s", ptr);
do {
ptr = strchr(url, '\\');
if (ptr)
*ptr = '/';
} while (ptr);
urllen = sizeof(url);
UrlCanonicalizeA(tmpfile, url, &urllen, URL_WININET_COMPATIBILITY);
pBlobArray = (CRYPT_BLOB_ARRAY *)0xdeadbeef;
ret = CryptRetrieveObjectByUrlA(url, NULL, 0, 0, (void **)&pBlobArray,