summaryrefslogtreecommitdiff
path: root/src/corelib/io/qfsfileengine_win.cpp
diff options
context:
space:
mode:
authorRitt Konstantin <ritt.ks@gmail.com>2010-01-07 19:28:52 +0100
committerJoão Abecasis <joao@trolltech.com>2010-01-07 19:30:27 +0100
commit428a624f73ed03a311f572386de1a518ad3d5d5a (patch)
tree5120a36685756d1697ca9e49bb35c2764ec1c852 /src/corelib/io/qfsfileengine_win.cpp
parentc24d7011e3e0cd84ce5bce4755ee9a6473bd60c0 (diff)
downloadqt4-tools-428a624f73ed03a311f572386de1a518ad3d5d5a.tar.gz
improve readability a bit more
Merge-request: 815 Reviewed-by: João Abecasis <joao@trolltech.com>
Diffstat (limited to 'src/corelib/io/qfsfileengine_win.cpp')
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index 1c3c801174..c3ea08a8a3 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -1718,27 +1718,28 @@ uint QFSFileEngine::ownerId(FileOwner /*own*/) const
QString QFSFileEngine::owner(FileOwner own) const
{
+ QString name;
#if !defined(QT_NO_LIBRARY)
Q_D(const QFSFileEngine);
+
if ((qt_ntfs_permission_lookup > 0) && ((QSysInfo::WindowsVersion&QSysInfo::WV_NT_based) > QSysInfo::WV_NT)) {
- QString name;
QFSFileEnginePrivate::resolveLibs();
if (ptrGetNamedSecurityInfoW && ptrLookupAccountSidW) {
PSID pOwner = 0;
PSECURITY_DESCRIPTOR pSD;
if (ptrGetNamedSecurityInfoW((wchar_t*)d->filePath.utf16(), SE_FILE_OBJECT,
- own == OwnerGroup ? GROUP_SECURITY_INFORMATION : OWNER_SECURITY_INFORMATION,
- own == OwnerUser ? &pOwner : 0, own == OwnerGroup ? &pOwner : 0,
- 0, 0, &pSD) == ERROR_SUCCESS) {
+ own == OwnerGroup ? GROUP_SECURITY_INFORMATION : OWNER_SECURITY_INFORMATION,
+ own == OwnerUser ? &pOwner : 0, own == OwnerGroup ? &pOwner : 0,
+ 0, 0, &pSD) == ERROR_SUCCESS) {
DWORD lowner = 0, ldomain = 0;
- SID_NAME_USE use;
+ SID_NAME_USE use = SidTypeUnknown;
// First call, to determine size of the strings (with '\0').
ptrLookupAccountSidW(NULL, pOwner, NULL, &lowner, NULL, &ldomain, (SID_NAME_USE*)&use);
wchar_t *owner = new wchar_t[lowner];
wchar_t *domain = new wchar_t[ldomain];
// Second call, size is without '\0'
if (ptrLookupAccountSidW(NULL, pOwner, (LPWSTR)owner, &lowner,
- (LPWSTR)domain, &ldomain, (SID_NAME_USE*)&use)) {
+ (LPWSTR)domain, &ldomain, (SID_NAME_USE*)&use)) {
name = QString::fromUtf16((ushort*)owner);
}
LocalFree(pSD);
@@ -1746,12 +1747,11 @@ QString QFSFileEngine::owner(FileOwner own) const
delete [] domain;
}
}
- return name;
}
#else
Q_UNUSED(own);
#endif
- return QString();
+ return name;
}
bool QFSFileEngine::setPermissions(uint perms)