Kaydet (Commit) a2c45688 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

Revert "cppcheck reduce scope of var in sal/... security.c"

This reverts commit 04028b90.
use c99 construct in c, which break Microsoft
üst c937997a
...@@ -469,6 +469,37 @@ sal_Bool SAL_CALL osl_getHomeDir(oslSecurity Security, rtl_uString **pustrDirect ...@@ -469,6 +469,37 @@ sal_Bool SAL_CALL osl_getHomeDir(oslSecurity Security, rtl_uString **pustrDirect
} }
else 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) && bSuccess = (sal_Bool)(GetSpecialFolder(&ustrSysDir, CSIDL_PERSONAL) &&
(osl_File_E_None == osl_getFileURLFromSystemPath(ustrSysDir, pustrDirectory))); (osl_File_E_None == osl_getFileURLFromSystemPath(ustrSysDir, pustrDirectory)));
} }
...@@ -548,6 +579,7 @@ sal_Bool SAL_CALL osl_loadUserProfile(oslSecurity Security) ...@@ -548,6 +579,7 @@ sal_Bool SAL_CALL osl_loadUserProfile(oslSecurity Security)
LPFNLOADUSERPROFILE fLoadUserProfile = NULL; LPFNLOADUSERPROFILE fLoadUserProfile = NULL;
LPFNUNLOADUSERPROFILE fUnloadUserProfile = NULL; LPFNUNLOADUSERPROFILE fUnloadUserProfile = NULL;
HANDLE hAccessToken = ((oslSecurityImpl*)Security)->m_hToken; HANDLE hAccessToken = ((oslSecurityImpl*)Security)->m_hToken;
DWORD nError = 0;
/* try to create user profile */ /* try to create user profile */
if ( !hAccessToken ) if ( !hAccessToken )
...@@ -589,7 +621,7 @@ sal_Bool SAL_CALL osl_loadUserProfile(oslSecurity Security) ...@@ -589,7 +621,7 @@ sal_Bool SAL_CALL osl_loadUserProfile(oslSecurity Security)
bOk = TRUE; bOk = TRUE;
} }
else else
DWORD nError = GetLastError(); nError = GetLastError();
rtl_uString_release(buffer); rtl_uString_release(buffer);
} }
......
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