summaryrefslogtreecommitdiff
path: root/desktop/win32
diff options
context:
space:
mode:
authorPierre-André Jacquod <pjacquod@alumni.ethz.ch>2011-10-02 12:29:22 +0200
committerPierre-André Jacquod <pjacquod@alumni.ethz.ch>2011-10-07 15:57:41 +0200
commitb64cccce574e98cc90882f5d5b6ab414aa23abae (patch)
treebcf9b6a29f2975c404efd609a35d64e7e8ddc998 /desktop/win32
parentef790a1bf17b6378766657607a2de7d2a2d21800 (diff)
cppcheck scope reduction of var in desktop/win32/...setup.cpp
Diffstat (limited to 'desktop/win32')
-rw-r--r--desktop/win32/source/setup/setup.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/desktop/win32/source/setup/setup.cpp b/desktop/win32/source/setup/setup.cpp
index a85a74b570ce..84065cce6959 100644
--- a/desktop/win32/source/setup/setup.cpp
+++ b/desktop/win32/source/setup/setup.cpp
@@ -1703,13 +1703,12 @@ boolean SetupAppX::IsAdmin()
// NT4, check groups of user
HANDLE hAccessToken = 0;
UCHAR *szInfoBuffer = new UCHAR[ 1024 ]; // may need to resize if TokenInfo too big
- DWORD dwInfoBufferSize = 1024;
DWORD dwRetInfoBufferSize = 0;
- UINT i=0;
if ( WIN::OpenProcessToken( WIN::GetCurrentProcess(), TOKEN_READ, &hAccessToken ) )
{
bool bSuccess = false;
+ DWORD dwInfoBufferSize = 1024;
bSuccess = WIN::GetTokenInformation( hAccessToken, TokenGroups,
szInfoBuffer, dwInfoBufferSize,
&dwRetInfoBufferSize ) == TRUE;
@@ -1729,7 +1728,7 @@ boolean SetupAppX::IsAdmin()
if ( bSuccess )
{
PTOKEN_GROUPS pGroups = (PTOKEN_GROUPS)(UCHAR*) szInfoBuffer;
- for( i=0; i<pGroups->GroupCount; i++ )
+ for( UINT i = 0; i < pGroups->GroupCount; i++ )
{
if( WIN::EqualSid( aPsidAdmin, pGroups->Groups[i].Sid ) )
{