result.mtime = Time::TimeStamp(Time::filetime_to_rawtime(info.ftLastWriteTime));
PSECURITY_DESCRIPTOR sec_desc;
- PSID owner;
- PSID group;
+ PSID owner = 0;
+ PSID group = 0;
if(!GetSecurityInfo(handle, SE_FILE_OBJECT, OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION, &owner, &group, 0, 0, &sec_desc))
{
CloseHandle(handle);
throw system_error("GetSecurityInfo");
}
- result.owner = get_account_name(owner);
- result.group = get_account_name(group);
+ if(owner)
+ result.owner = get_account_name(owner);
+ if(group)
+ result.group = get_account_name(group);
LocalFree(sec_desc);