Author: tkreuzer
Date: Sat Jan 11 15:23:53 2014
New Revision: 61582
URL: http://svn.reactos.org/svn/reactos?rev=61582&view=rev
Log:
[NTOSKRNL]
Small optimization of SepPrivilegeCheck
Modified:
trunk/reactos/ntoskrnl/se/priv.c
Modified: trunk/reactos/ntoskrnl/se/priv.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/priv.c?rev=615…
==============================================================================
--- trunk/reactos/ntoskrnl/se/priv.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/se/priv.c [iso-8859-1] Sat Jan 11 15:23:53 2014
@@ -90,7 +90,7 @@
Required = (PrivilegeControl & PRIVILEGE_SET_ALL_NECESSARY) ? PrivilegeCount : 1;
/* Loop all requested privileges until we found the required ones */
- for (i = 0; i < PrivilegeCount && Required > 0; i++)
+ for (i = 0; i < PrivilegeCount; i++)
{
/* Loop the privileges of the token */
for (j = 0; j < Token->PrivilegeCount; j++)
@@ -107,6 +107,13 @@
{
Privileges[i].Attributes |= SE_PRIVILEGE_USED_FOR_ACCESS;
Required--;
+
+ /* Check if we have found all privileges */
+ if (Required == 0)
+ {
+ /* We're done! */
+ return TRUE;
+ }
}
/* Leave the inner loop */
@@ -115,8 +122,9 @@
}
}
- /* Return whether we found all required privileges */
- return (Required == 0);
+ /* When we reached this point, we did not find all privileges */
+ NT_ASSERT(Required > 0);
+ return FALSE;
}
NTSTATUS
Author: ekohl
Date: Sat Jan 11 14:43:31 2014
New Revision: 61581
URL: http://svn.reactos.org/svn/reactos?rev=61581&view=rev
Log:
[MSGINA]
GUIDisplaySASNotice: Use the WlxDialogBoyParam function to create the SAS notice dialog.
Modified:
trunk/reactos/dll/win32/msgina/gui.c
Modified: trunk/reactos/dll/win32/msgina/gui.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/gui.c?rev…
==============================================================================
--- trunk/reactos/dll/win32/msgina/gui.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msgina/gui.c [iso-8859-1] Sat Jan 11 14:43:31 2014
@@ -184,23 +184,15 @@
GUIDisplaySASNotice(
IN OUT PGINA_CONTEXT pgContext)
{
- INT result;
-
TRACE("GUIDisplaySASNotice()\n");
/* Display the notice window */
- result = DialogBoxParam(
- pgContext->hDllInstance,
- MAKEINTRESOURCE(IDD_NOTICE_DLG),
- GetDesktopWindow(),
- EmptyWindowProc,
- (LPARAM)NULL);
- if (result == -1)
- {
- /* Failed to display the window. Do as if the user
- * already has pressed CTRL+ALT+DELETE */
- pgContext->pWlxFuncs->WlxSasNotify(pgContext->hWlx, WLX_SAS_TYPE_CTRL_ALT_DEL);
- }
+ pgContext->pWlxFuncs->WlxDialogBoxParam(pgContext->hWlx,
+ pgContext->hDllInstance,
+ MAKEINTRESOURCEW(IDD_NOTICE_DLG),
+ GetDesktopWindow(),
+ EmptyWindowProc,
+ (LPARAM)NULL);
}
/* Get the text contained in a textbox. Allocates memory in pText