Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

luid.c File Reference

#include "exp.h"

Go to the source code of this file.

Functions

BOOLEAN ExLuidInitialization (VOID)
NTSTATUS NtAllocateLocallyUniqueId (OUT PLUID Luid)

Variables

LARGE_INTEGER ExpLuid
LARGE_INTEGER ExpLuidIncrement
KSPIN_LOCK ExpLuidLock


Function Documentation

BOOLEAN ExLuidInitialization VOID   ) 
 

Definition at line 37 of file luid.c.

References ExpLuid, ExpLuidIncrement, ExpLuidLock, KeInitializeSpinLock(), and TRUE.

Referenced by SepInitializationPhase0().

00043 : 00044 00045 This function initializes the locally unique identifier allocation. 00046 00047 NOTE: THE LUID ALLOCATION SERVICES ARE NEEDED BY SECURITY IN PHASE 0 00048 SYSTEM INITIALIZATION. FOR THIS REASON, LUID INITIALIZATION IS 00049 PERFORMED AS PART OF PHASE 0 SECURITY INITIALIZATION. 00050 00051 Arguments: 00052 00053 None. 00054 00055 Return Value: 00056 00057 A value of TRUE is returned if the initialization is successfully 00058 completed. Otherwise, a value of FALSE is returned. 00059 00060 --*/ 00061 00062 { 00063 00064 // 00065 // Initialize the LUID source value. 00066 // 00067 // The first 1000 values are reserved for static definition. This 00068 // value can be increased with later releases with no adverse impact. 00069 // 00070 // N.B. The LUID source always refers to the "next" allocatable LUID. 00071 // 00072 00073 ExpLuid.LowPart = 1001; 00074 ExpLuid.HighPart = 0; 00075 KeInitializeSpinLock(&ExpLuidLock); 00076 ExpLuidIncrement.QuadPart = 1; 00077 return TRUE; 00078 }

NTSTATUS NtAllocateLocallyUniqueId OUT PLUID  Luid  ) 
 

Definition at line 81 of file luid.c.

References ExAllocateLocallyUniqueId, ExSystemExceptionFilter(), KernelMode, KPROCESSOR_MODE, NTSTATUS(), ProbeForWrite(), and Status.

Referenced by TestTokenInitialize().

00087 : 00088 00089 This function returns an LUID value that is unique since the system 00090 was last rebooted. It is unique on the system it is generated on 00091 only (not network wide). 00092 00093 There are no restrictions on who can allocate LUIDs. The LUID space 00094 is large enough that this will never present a problem. If one LUID 00095 is allocated every 100ns, they will not be exhausted for roughly 00096 15,000 years (100ns * 2^63). 00097 00098 Arguments: 00099 00100 Luid - Supplies the address of a variable that will receive the 00101 new LUID. 00102 00103 Return Value: 00104 00105 STATUS_SUCCESS is returned if the service is successfully executed. 00106 00107 STATUS_ACCESS_VIOLATION is returned if the output parameter for the 00108 LUID cannot be written. 00109 00110 --*/ 00111 00112 { 00113 00114 KPROCESSOR_MODE PreviousMode; 00115 NTSTATUS Status; 00116 00117 // 00118 // Establish an exception handler and attempt to write the Luid 00119 // to the specified variable. If the write attempt fails, then return 00120 // the exception code as the service status. Otherwise return success 00121 // as the service status. 00122 // 00123 00124 try { 00125 00126 // 00127 // Get previous processor mode and probe argument if necessary. 00128 // 00129 00130 PreviousMode = KeGetPreviousMode(); 00131 if (PreviousMode != KernelMode) { 00132 ProbeForWrite((PVOID)Luid, sizeof(LUID), sizeof(ULONG)); 00133 } 00134 00135 // 00136 // Allocate and store a locally unique Id. 00137 // 00138 00139 ExAllocateLocallyUniqueId(Luid); 00140 00141 } except (ExSystemExceptionFilter()) { 00142 return GetExceptionCode(); 00143 } 00144 00145 return STATUS_SUCCESS; 00146 } }


Variable Documentation

LARGE_INTEGER ExpLuid
 

Definition at line 27 of file luid.c.

Referenced by ExLuidInitialization().

LARGE_INTEGER ExpLuidIncrement
 

Definition at line 28 of file luid.c.

Referenced by ExLuidInitialization().

KSPIN_LOCK ExpLuidLock
 

Definition at line 29 of file luid.c.


Generated on Sat May 15 19:44:34 2004 for test by doxygen 1.3.7