Commit 35f8d739 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

cryptnet/tests: Use UrlCanonicalize to create a URL.

parent 602d44a1
TESTDLL = cryptnet.dll
IMPORTS = cryptnet crypt32
IMPORTS = cryptnet crypt32 shlwapi
C_SRCS = \
cryptnet.c
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment