[ros-dev] [PATCH] Fix LUID constants
Nedko Arnaudov
nedko at users.sourceforge.net
Wed Jan 5 05:18:23 CET 2005
The attached patch fixes "warnings + -Werror = not compile" for
rosapps/tests/tokentest/tokentest.c
tokentest.c: In function `CreateInitialSystemToken':
tokentest.c:359: warning: braces around scalar initializer
tokentest.c:359: warning: (near initialization for `authId.LowPart')
tokentest.c:359: warning: excess elements in scalar initializer
tokentest.c:359: warning: (near initialization for `authId.LowPart')
I think SYSTEM_LUID and similar macros for initial values are intended
as initializers of LUID variables, not LARGE_INTEGER ones.
I've posted this (and not commited it myself) because I can be missing
something important. Is there other issue with LUID <-> LARGE_INTEGER ?
<#secure method=pgpmime mode=sign>
-------------- next part --------------
Index: reactos/include/ntos/security.h
===================================================================
--- reactos/include/ntos/security.h (revision 12807)
+++ reactos/include/ntos/security.h (working copy)
@@ -74,17 +74,10 @@
#ifndef __USE_W32API
-#ifndef _MSC_VER
-#define SYSTEM_LUID {{ 0x3E7, 0x0 }}
-#define ANONYMOUS_LOGON_LUID {{ 0x3e6, 0x0 }}
-#define LOCALSERVICE_LUID {{ 0x3e5, 0x0 }}
-#define NETWORKSERVICE_LUID {{ 0x3e4, 0x0 }}
-#else
#define SYSTEM_LUID { 0x3E7, 0x0 }
#define ANONYMOUS_LOGON_LUID { 0x3e6, 0x0 }
#define LOCALSERVICE_LUID { 0x3e5, 0x0 }
#define NETWORKSERVICE_LUID { 0x3e4, 0x0 }
-#endif
/* SID Auhority */
#define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
Index: reactos/ntoskrnl/se/luid.c
===================================================================
--- reactos/ntoskrnl/se/luid.c (revision 12807)
+++ reactos/ntoskrnl/se/luid.c (working copy)
@@ -25,10 +25,11 @@
VOID INIT_FUNCTION
SepInitLuid(VOID)
{
- LARGE_INTEGER DummyLuidValue = SYSTEM_LUID;
+ LUID DummyLuidValue = SYSTEM_LUID;
KeInitializeSpinLock(&LuidLock);
- LuidValue = DummyLuidValue;
+ LuidValue.u.LowPart = DummyLuidValue.LowPart;
+ LuidValue.u.HighPart = DummyLuidValue.HighPart;
LuidIncrement.QuadPart = 1;
}
-------------- next part --------------
--
Nedko Arnaudov <GnuPG KeyID: DE1716B0>
More information about the Ros-dev
mailing list