Commit 25102d6b authored by Stefan Leichter's avatar Stefan Leichter Committed by Alexandre Julliard

Fix GetFileSecurityW for not existing directories/files.

parent 61beaf48
...@@ -1323,6 +1323,9 @@ GetFileSecurityW( LPCWSTR lpFileName, ...@@ -1323,6 +1323,9 @@ GetFileSecurityW( LPCWSTR lpFileName,
DWORD iLocNow; DWORD iLocNow;
SECURITY_DESCRIPTOR_RELATIVE *pSDRelative; SECURITY_DESCRIPTOR_RELATIVE *pSDRelative;
if(INVALID_FILE_ATTRIBUTES == GetFileAttributesW(lpFileName))
return FALSE;
FIXME("(%s) : returns fake SECURITY_DESCRIPTOR\n", debugstr_w(lpFileName) ); FIXME("(%s) : returns fake SECURITY_DESCRIPTOR\n", debugstr_w(lpFileName) );
nNeeded = sizeof(SECURITY_DESCRIPTOR_RELATIVE); nNeeded = sizeof(SECURITY_DESCRIPTOR_RELATIVE);
......
...@@ -425,8 +425,9 @@ static void test_FileSecurity(void) ...@@ -425,8 +425,9 @@ static void test_FileSecurity(void)
SetLastError(NO_ERROR); SetLastError(NO_ERROR);
result = pGetFileSecurityA( directory,OWNER_SECURITY_INFORMATION,buffer,0x40,&outSize); result = pGetFileSecurityA( directory,OWNER_SECURITY_INFORMATION,buffer,0x40,&outSize);
todo_wine ok(!result, "GetFileSecurityA should fail for not existing directories\n"); ok(!result, "GetFileSecurityA should fail for not existing directories/files\n");
todo_wine ok( GetLastError() == ERROR_FILE_NOT_FOUND, "ERROR_FILE_NOT_FOUND expected\n"); ok( GetLastError() == ERROR_FILE_NOT_FOUND,
"last error ERROR_FILE_NOT_FOUND expected, got %ld\n", GetLastError());
} }
START_TEST(security) START_TEST(security)
......
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