finished applying @implemented and @unimplemented comments and remove the comments...
[reactos.git] / reactos / ntoskrnl / se / luid.c
1 /* $Id: luid.c,v 1.8 2003/07/11 01:23:16 royce Exp $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * PURPOSE: Security manager
6 * FILE: ntoskrnl/se/luid.c
7 * PROGRAMER: ?
8 * REVISION HISTORY:
9 * 26/07/98: Added stubs for security functions
10 */
11
12 /* INCLUDES *****************************************************************/
13
14 #include <ddk/ntddk.h>
15
16 #include <internal/debug.h>
17
18 /* GLOBALS *******************************************************************/
19
20 static KSPIN_LOCK LuidLock;
21 static LARGE_INTEGER LuidIncrement;
22 static LARGE_INTEGER LuidValue;
23
24 #define SYSTEM_LUID 0x3E7;
25
26 /* FUNCTIONS *****************************************************************/
27
28 VOID
29 SepInitLuid(VOID)
30 {
31 KeInitializeSpinLock(&LuidLock);
32 LuidValue.QuadPart = SYSTEM_LUID;
33 LuidIncrement.QuadPart = 1;
34 }
35
36
37 /*
38 * @implemented
39 */
40 NTSTATUS STDCALL
41 NtAllocateLocallyUniqueId(OUT LUID *LocallyUniqueId)
42 {
43 LARGE_INTEGER ReturnedLuid;
44 KIRQL Irql;
45
46 KeAcquireSpinLock(&LuidLock,
47 &Irql);
48 ReturnedLuid = LuidValue;
49 LuidValue = RtlLargeIntegerAdd(LuidValue,
50 LuidIncrement);
51 KeReleaseSpinLock(&LuidLock,
52 Irql);
53
54 LocallyUniqueId->LowPart = ReturnedLuid.u.LowPart;
55 LocallyUniqueId->HighPart = ReturnedLuid.u.HighPart;
56
57 return(STATUS_SUCCESS);
58 }
59
60
61 /*
62 * @implemented
63 */
64 VOID STDCALL
65 RtlCopyLuid(IN PLUID LuidDest,
66 IN PLUID LuidSrc)
67 {
68 LuidDest->LowPart = LuidSrc->LowPart;
69 LuidDest->HighPart = LuidSrc->HighPart;
70 }
71
72
73 /*
74 * @implemented
75 */
76 BOOLEAN STDCALL
77 RtlEqualLuid(IN PLUID Luid1,
78 IN PLUID Luid2)
79 {
80 return (Luid1->LowPart == Luid2->LowPart &&
81 Luid1->HighPart == Luid2->HighPart);
82 }
83
84 /* EOF */