Paul Vriens : wintrust/tests: Check file attributes set by CryptCATAdminAddCatalog.
Alexandre Julliard
julliard at winehq.org
Wed Jan 21 06:39:21 CST 2009
Module: wine
Branch: master
Commit: d18249dda6b902c0816dd018ea49e2b575ca0491
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d18249dda6b902c0816dd018ea49e2b575ca0491
Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date: Tue Jan 20 18:18:13 2009 +0100
wintrust/tests: Check file attributes set by CryptCATAdminAddCatalog.
---
dlls/wintrust/tests/crypt.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/dlls/wintrust/tests/crypt.c b/dlls/wintrust/tests/crypt.c
index 1440f1d..882b939 100644
--- a/dlls/wintrust/tests/crypt.c
+++ b/dlls/wintrust/tests/crypt.c
@@ -522,6 +522,11 @@ static void test_CryptCATAdminAddRemoveCatalog(void)
memset(catfileW, 0, sizeof(catfileW));
MultiByteToWideChar(0, 0, p, -1, catfileW, MAX_PATH);
+ /* Set the file attributes so we can check what happens with them during the 'copy' */
+ attrs = FILE_ATTRIBUTE_READONLY;
+ ret = SetFileAttributesA(tmpfile, attrs);
+ ok(ret, "SetFileAttributesA failed : %u\n", GetLastError());
+
/* winetest.cat will be created */
hcatinfo = pCryptCATAdminAddCatalog(hcatadmin, tmpfileW, basenameW, 0);
ok(hcatinfo != NULL, "CryptCATAdminAddCatalog failed %u\n", GetLastError());
@@ -530,6 +535,10 @@ static void test_CryptCATAdminAddRemoveCatalog(void)
lstrcatA(catfilepath, "\\{DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF}\\winetest.cat");
attrs = GetFileAttributes(catfilepath);
ok(attrs != INVALID_FILE_ATTRIBUTES, "Expected %s to exist\n", catfilepath);
+ todo_wine
+ ok(attrs == FILE_ATTRIBUTE_SYSTEM ||
+ attrs == (FILE_ATTRIBUTE_NOT_CONTENT_INDEXED | FILE_ATTRIBUTE_SYSTEM), /* Vista */
+ "File has wrong attributes : %08x\n", attrs);
info.cbStruct = sizeof(info);
info.wszCatalogFile[0] = 0;
@@ -563,6 +572,9 @@ static void test_CryptCATAdminAddRemoveCatalog(void)
ret = pCryptCATAdminReleaseContext(hcatadmin, 0);
ok(ret, "CryptCATAdminReleaseContext failed %u\n", GetLastError());
+ /* Set the attributes so we can delete the file */
+ attrs = FILE_ATTRIBUTE_NORMAL;
+ ret = SetFileAttributesA(tmpfile, attrs);
DeleteFileA(tmpfile);
}
More information about the wine-cvs
mailing list