fixed IsUserAdmin and enable the calls to it
Modified: trunk/reactos/lib/newdev/newdev.c
Modified: trunk/reactos/lib/setupapi/cfgmgr.c
Modified: trunk/reactos/lib/setupapi/misc.c

Modified: trunk/reactos/lib/newdev/newdev.c
--- trunk/reactos/lib/newdev/newdev.c	2005-12-17 20:59:51 UTC (rev 20231)
+++ trunk/reactos/lib/newdev/newdev.c	2005-12-17 21:13:36 UTC (rev 20232)
@@ -1018,16 +1018,12 @@
     PROPSHEETPAGE psp;
     BOOL ret;
     DWORD config_flags;
-    /*TCHAR buf[128];*/
 
-    /* FIXME: Nov 2005. umpnpmgr.exe is directly calling DevInstallW in
-     * SYSTEM context, which is not member of the Administrators group.
-     * So, just ignore the test at the moment... */
-    //if (!IsUserAdmin())
-    //{
-    //    /* XP kills the process... */
-    //    ExitProcess(ERROR_ACCESS_DENIED);
-    //}
+    if (!IsUserAdmin())
+    {
+        /* XP kills the process... */
+        ExitProcess(ERROR_ACCESS_DENIED);
+    }
 
     /* Clear devinst data */
     ZeroMemory(&DevInstData, sizeof(DEVINSTDATA));

Modified: trunk/reactos/lib/setupapi/cfgmgr.c
--- trunk/reactos/lib/setupapi/cfgmgr.c	2005-12-17 20:59:51 UTC (rev 20231)
+++ trunk/reactos/lib/setupapi/cfgmgr.c	2005-12-17 21:13:36 UTC (rev 20232)
@@ -104,7 +104,7 @@
     if (!PnpGetLocalHandles(&BindingHandle, NULL))
         return CR_FAILURE;
 
-    bAdmin = TRUE; //IsUserAdmin();
+    bAdmin = IsUserAdmin();
 
     for (i = 0; i < 30; i++)
     {
@@ -256,8 +256,8 @@
 
     FIXME("%p %lx %p\n", dnDevInst, ulFlags, hMachine);
 
-//    if (!IsUserAdmin())
-//        return CR_ACCESS_DENIED;
+    if (!IsUserAdmin())
+        return CR_ACCESS_DENIED;
 
     if (dnDevInst == 0)
         return CR_INVALID_DEVINST;
@@ -341,8 +341,8 @@
 
     FIXME("%p %lx %p\n", dnDevInst, ulFlags, hMachine);
 
-//    if (!IsUserAdmin())
-//        return CR_ACCESS_DENIED;
+    if (!IsUserAdmin())
+        return CR_ACCESS_DENIED;
 
     if (dnDevInst == 0)
         return CR_INVALID_DEVINST;
@@ -1921,8 +1921,8 @@
     FIXME("%lx %lx %lx %lx\n",
           dnFromDevInst, dnToDevInst, ulFlags, hMachine);
 
-//    if (!IsUserAdmin())
-//        return CR_ACCESS_DENIED;
+    if (!IsUserAdmin())
+        return CR_ACCESS_DENIED;
 
     if (dnFromDevInst == 0 || dnToDevInst == 0)
         return CR_INVALID_DEVNODE;
@@ -2236,8 +2236,8 @@
 
     TRACE("%lx %lx\n", ulFlags, hMachine);
 
-//    if (!IsUserAdmin())
-//        return CR_ACCESS_DENIED;
+    if (!IsUserAdmin())
+        return CR_ACCESS_DENIED;
 
     if (ulFlags & ~CM_DETECT_BITS)
         return CR_INVALID_FLAG;
@@ -2616,8 +2616,8 @@
 
     FIXME("%lx %lx %lx\n", dnDevInst, ulFlags, hMachine);
 
-//    if (!IsUserAdmin())
-//        return CR_ACCESS_DENIED;
+    if (!IsUserAdmin())
+        return CR_ACCESS_DENIED;
 
     if (dnDevInst == 0)
         return CR_INVALID_DEVNODE;

Modified: trunk/reactos/lib/setupapi/misc.c
--- trunk/reactos/lib/setupapi/misc.c	2005-12-17 20:59:51 UTC (rev 20231)
+++ trunk/reactos/lib/setupapi/misc.c	2005-12-17 21:13:36 UTC (rev 20232)
@@ -234,7 +234,7 @@
 
     for (i = 0; i < lpGroups->GroupCount; i++)
     {
-        if (EqualSid(lpSid, &lpGroups->Groups[i].Sid))
+        if (EqualSid(lpSid, lpGroups->Groups[i].Sid))
         {
             bResult = TRUE;
             break;