Fix GetFileSecurityW for not existing directories/files.
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index 993f49b..94e8f91 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -1323,6 +1323,9 @@
DWORD iLocNow;
SECURITY_DESCRIPTOR_RELATIVE *pSDRelative;
+ if(INVALID_FILE_ATTRIBUTES == GetFileAttributesW(lpFileName))
+ return FALSE;
+
FIXME("(%s) : returns fake SECURITY_DESCRIPTOR\n", debugstr_w(lpFileName) );
nNeeded = sizeof(SECURITY_DESCRIPTOR_RELATIVE);
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 71338f0..5e17045 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -425,8 +425,9 @@
SetLastError(NO_ERROR);
result = pGetFileSecurityA( directory,OWNER_SECURITY_INFORMATION,buffer,0x40,&outSize);
- todo_wine ok(!result, "GetFileSecurityA should fail for not existing directories\n");
- todo_wine ok( GetLastError() == ERROR_FILE_NOT_FOUND, "ERROR_FILE_NOT_FOUND expected\n");
+ ok(!result, "GetFileSecurityA should fail for not existing directories/files\n");
+ ok( GetLastError() == ERROR_FILE_NOT_FOUND,
+ "last error ERROR_FILE_NOT_FOUND expected, got %ld\n", GetLastError());
}
START_TEST(security)