mirror of
https://github.com/reactos/reactos.git
synced 2025-07-28 03:52:17 +00:00
[IMAGEHLP_WINETEST]
- Sync to Wine 1.3.37 svn path=/trunk/; revision=56174
This commit is contained in:
parent
4e74ad59de
commit
e88971e564
1 changed files with 10 additions and 5 deletions
|
@ -141,6 +141,7 @@ static void test_add_certificate(char *cert_data, int len)
|
||||||
LPWIN_CERTIFICATE cert;
|
LPWIN_CERTIFICATE cert;
|
||||||
DWORD cert_len;
|
DWORD cert_len;
|
||||||
DWORD index;
|
DWORD index;
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
hFile = CreateFileA(test_dll_path, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
hFile = CreateFileA(test_dll_path, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
|
|
||||||
|
@ -165,7 +166,8 @@ static void test_add_certificate(char *cert_data, int len)
|
||||||
cert->wCertificateType = WIN_CERT_TYPE_PKCS_SIGNED_DATA;
|
cert->wCertificateType = WIN_CERT_TYPE_PKCS_SIGNED_DATA;
|
||||||
CopyMemory(cert->bCertificate, cert_data, len);
|
CopyMemory(cert->bCertificate, cert_data, len);
|
||||||
|
|
||||||
ok(pImageAddCertificate(hFile, cert, &index), "Unable to add certificate to image, error %x\n", GetLastError());
|
ret = pImageAddCertificate(hFile, cert, &index);
|
||||||
|
ok(ret, "Unable to add certificate to image, error %x\n", GetLastError());
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, cert);
|
HeapFree(GetProcessHeap(), 0, cert);
|
||||||
CloseHandle(hFile);
|
CloseHandle(hFile);
|
||||||
|
@ -200,7 +202,8 @@ static void test_get_certificate(char *cert_data, int index)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ok(ret = pImageGetCertificateData(hFile, index, cert, &cert_len), "Unable to retrieve certificate; err=%x\n", GetLastError());
|
ret = pImageGetCertificateData(hFile, index, cert, &cert_len);
|
||||||
|
ok(ret, "Unable to retrieve certificate; err=%x\n", GetLastError());
|
||||||
ok(memcmp(cert->bCertificate, cert_data, cert_len - sizeof(WIN_CERTIFICATE)) == 0, "Certificate retrieved did not match original\n");
|
ok(memcmp(cert->bCertificate, cert_data, cert_len - sizeof(WIN_CERTIFICATE)) == 0, "Certificate retrieved did not match original\n");
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, cert);
|
HeapFree(GetProcessHeap(), 0, cert);
|
||||||
|
@ -211,6 +214,7 @@ static void test_remove_certificate(int index)
|
||||||
{
|
{
|
||||||
DWORD orig_count = 0, count = 0;
|
DWORD orig_count = 0, count = 0;
|
||||||
HANDLE hFile;
|
HANDLE hFile;
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
hFile = CreateFileA(test_dll_path, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
hFile = CreateFileA(test_dll_path, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
|
|
||||||
|
@ -220,9 +224,10 @@ static void test_remove_certificate(int index)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ok (pImageEnumerateCertificates(hFile, CERT_SECTION_TYPE_ANY, &orig_count, NULL, 0), "Unable to enumerate certificates in file; err=%x\n", GetLastError());
|
ret = pImageEnumerateCertificates(hFile, CERT_SECTION_TYPE_ANY, &orig_count, NULL, 0);
|
||||||
|
ok (ret, "Unable to enumerate certificates in file; err=%x\n", GetLastError());
|
||||||
ok (pImageRemoveCertificate(hFile, index), "Unable to remove certificate from file; err=%x\n", GetLastError());
|
ret = pImageRemoveCertificate(hFile, index);
|
||||||
|
ok (ret, "Unable to remove certificate from file; err=%x\n", GetLastError());
|
||||||
|
|
||||||
/* Test to see if the certificate has actually been removed */
|
/* Test to see if the certificate has actually been removed */
|
||||||
pImageEnumerateCertificates(hFile, CERT_SECTION_TYPE_ANY, &count, NULL, 0);
|
pImageEnumerateCertificates(hFile, CERT_SECTION_TYPE_ANY, &count, NULL, 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue