summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorPierre-André Jacquod <pjacquod@alumni.ethz.ch>2011-10-02 16:15:09 +0200
committerPierre-André Jacquod <pjacquod@alumni.ethz.ch>2011-10-07 15:57:47 +0200
commit04028b90252888848c0fc911ea3ad3aa49d9a5b5 (patch)
tree90bf27604b91813dd215ce81f8c2c3420b53cb45 /sal
parent0921457488898b43152e33d1184929f7436aeeb4 (diff)
cppcheck reduce scope of var in sal/... security.c
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/w32/security.c34
1 files changed, 1 insertions, 33 deletions
diff --git a/sal/osl/w32/security.c b/sal/osl/w32/security.c
index 053d39f446c1..ac5387517515 100644
--- a/sal/osl/w32/security.c
+++ b/sal/osl/w32/security.c
@@ -469,37 +469,6 @@ sal_Bool SAL_CALL osl_getHomeDir(oslSecurity Security, rtl_uString **pustrDirect
}
else
{
-#if 0
- if (pSecImpl->m_hToken)
- {
- DWORD nInfoBuffer = 512;
- UCHAR* pInfoBuffer = malloc(nInfoBuffer);
-
- while (!GetTokenInformation(pSecImpl->m_hToken, TokenUser,
- pInfoBuffer, nInfoBuffer, &nInfoBuffer))
- {
- if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
- pInfoBuffer = realloc(pInfoBuffer, nInfoBuffer);
- else
- {
- free(pInfoBuffer);
- pInfoBuffer = NULL;
- break;
- }
- }
-
- /* not implemented */
- OSL_ASSERT(sal_False);
-
- if (pInfoBuffer)
- {
- /* if (EqualSid() ... */
-
- }
- }
- else
-#endif
-
bSuccess = (sal_Bool)(GetSpecialFolder(&ustrSysDir, CSIDL_PERSONAL) &&
(osl_File_E_None == osl_getFileURLFromSystemPath(ustrSysDir, pustrDirectory)));
}
@@ -579,7 +548,6 @@ sal_Bool SAL_CALL osl_loadUserProfile(oslSecurity Security)
LPFNLOADUSERPROFILE fLoadUserProfile = NULL;
LPFNUNLOADUSERPROFILE fUnloadUserProfile = NULL;
HANDLE hAccessToken = ((oslSecurityImpl*)Security)->m_hToken;
- DWORD nError = 0;
/* try to create user profile */
if ( !hAccessToken )
@@ -621,7 +589,7 @@ sal_Bool SAL_CALL osl_loadUserProfile(oslSecurity Security)
bOk = TRUE;
}
else
- nError = GetLastError();
+ DWORD nError = GetLastError();
rtl_uString_release(buffer);
}