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

rmp.h

Go to the documentation of this file.
00001 /*++ 00002 00003 Copyright (c) 1991 Microsoft Corporation 00004 00005 Module Name: 00006 00007 rmp.h 00008 00009 Abstract: 00010 00011 Security Reference Monitor Private Data Types, Functions and Defines 00012 00013 Author: 00014 00015 Scott Birrell (ScottBi) March 12, 1991 00016 00017 Environment: 00018 00019 Revision History: 00020 00021 --*/ 00022 00023 #include <nt.h> 00024 #include <ntlsa.h> 00025 #include "sep.h" 00026 00027 00029 // // 00030 // Reference Monitor Private defines // 00031 // // 00033 00034 00035 // 00036 // Used to define the bounds of the array used to track logon session 00037 // reference counts. 00038 // 00039 00040 #define SEP_LOGON_TRACK_INDEX_MASK (0x0000000FL) 00041 #define SEP_LOGON_TRACK_ARRAY_SIZE (0x00000010L) 00042 00043 00044 00045 00046 00048 // // 00049 // Reference Monitor Private Macros // 00050 // // 00052 00053 // 00054 // acquire exclusive access to a token 00055 // 00056 00057 #define SepRmAcquireDbReadLock() KeEnterCriticalRegion(); \ 00058 ExAcquireResourceShared(&SepRmDbLock, TRUE) 00059 00060 #define SepRmAcquireDbWriteLock() KeEnterCriticalRegion(); \ 00061 ExAcquireResourceExclusive(&SepRmDbLock, TRUE) 00062 00063 #define SepRmReleaseDbReadLock() ExReleaseResource(&SepRmDbLock); \ 00064 KeLeaveCriticalRegion() 00065 00066 #define SepRmReleaseDbWriteLock() ExReleaseResource(&SepRmDbLock); \ 00067 KeLeaveCriticalRegion() 00068 00069 00071 // // 00072 // Reference Monitor Private Data Types // 00073 // // 00075 00076 #define SEP_RM_LSA_SHARED_MEMORY_SIZE ((ULONG) PAGE_SIZE) 00077 00078 // 00079 // Reference Monitor Private Global State Data Structure 00080 // 00081 00082 typedef struct _SEP_RM_STATE { 00083 00084 HANDLE LsaInitEventHandle; 00085 HANDLE LsaCommandPortHandle; 00086 HANDLE SepRmThreadHandle; 00087 HANDLE RmCommandPortHandle; 00088 ULONG AuditingEnabled; 00089 LSA_OPERATIONAL_MODE OperationalMode; 00090 HANDLE LsaCommandPortSectionHandle; 00091 LARGE_INTEGER LsaCommandPortSectionSize; 00092 PVOID LsaViewPortMemory; 00093 PVOID RmViewPortMemory; 00094 LONG LsaCommandPortMemoryDelta; 00095 BOOLEAN LsaCommandPortResourceInitialized; 00096 BOOLEAN LsaCommandPortActive; 00097 ERESOURCE LsaCommandPortResource; 00098 00099 } SEP_RM_STATE, *PSEP_RM_STATE; 00100 00101 // 00102 // Reference Monitor Command Port Connection Info 00103 // 00104 00105 typedef struct _SEP_RM_CONNECT_INFO { 00106 ULONG ConnectInfo; 00107 } SEP_RM_CONNECT_INFO; 00108 00109 typedef struct SEP_RM_CONNECT_INFO *PSEP_RM_CONNECT_INFO; 00110 00111 00112 // 00113 // Reference Monitor Command Table Entry Format 00114 // 00115 00116 #define SEP_RM_COMMAND_MAX 4 00117 00118 typedef VOID (*SEP_RM_COMMAND_WORKER)( PRM_COMMAND_MESSAGE, PRM_REPLY_MESSAGE ); 00119 00120 00121 00122 // 00123 // Each logon session active in the system has a corresponding record of 00124 // the following type... 00125 // 00126 00127 typedef struct _SEP_LOGON_SESSION_REFERENCES { 00128 struct _SEP_LOGON_SESSION_REFERENCES *Next; 00129 LUID LogonId; 00130 ULONG ReferenceCount; 00131 ULONG Flags; 00132 } SEP_LOGON_SESSION_REFERENCES, *PSEP_LOGON_SESSION_REFERENCES; 00133 00134 #define SEP_TERMINATION_NOTIFY 0x1 00135 00136 // 00137 // File systems interested in being notified when a logon session is being 00138 // terminated register a callback routine. The following data structure 00139 // describes the callback routines. 00140 // 00141 // The global list of callback routines is pointed to by SeFileSystemNotifyRoutines. 00142 // This list is protected by the RM database lock. 00143 // 00144 00145 typedef struct _SEP_LOGON_SESSION_TERMINATED_NOTIFICATION { 00146 struct _SEP_LOGON_SESSION_TERMINATED_NOTIFICATION *Next; 00147 PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine; 00148 } SEP_LOGON_SESSION_TERMINATED_NOTIFICATION, *PSEP_LOGON_SESSION_TERMINATED_NOTIFICATION; 00149 00150 extern SEP_LOGON_SESSION_TERMINATED_NOTIFICATION 00151 SeFileSystemNotifyRoutinesHead; 00152 00153 00155 // // 00156 // Reference Monitor Private Function Prototypes // 00157 // // 00159 00160 BOOLEAN 00161 SepRmDbInitialization( 00162 VOID 00163 ); 00164 00165 VOID 00166 SepRmCommandServerThread( 00167 IN PVOID StartContext 00168 ); 00169 00170 BOOLEAN SepRmCommandServerThreadInit( 00171 ); 00172 00173 VOID 00174 SepRmComponentTestCommandWrkr( 00175 IN PRM_COMMAND_MESSAGE CommandMessage, 00176 OUT PRM_REPLY_MESSAGE ReplyMessage 00177 ); 00178 00179 VOID 00180 SepRmSetAuditEventWrkr( 00181 IN PRM_COMMAND_MESSAGE CommandMessage, 00182 OUT PRM_REPLY_MESSAGE ReplyMessage 00183 ); 00184 00185 VOID 00186 SepRmSendCommandToLsaWrkr( 00187 IN PRM_COMMAND_MESSAGE CommandMessage, 00188 OUT PRM_REPLY_MESSAGE ReplyMessage 00189 ); 00190 00191 VOID 00192 SepRmCreateLogonSessionWrkr( 00193 IN PRM_COMMAND_MESSAGE CommandMessage, 00194 OUT PRM_REPLY_MESSAGE ReplyMessage 00195 ); 00196 00197 VOID 00198 SepRmDeleteLogonSessionWrkr( 00199 IN PRM_COMMAND_MESSAGE CommandMessage, 00200 OUT PRM_REPLY_MESSAGE ReplyMessage 00201 ) ; 00202 00203 00204 NTSTATUS 00205 SepCreateLogonSessionTrack( 00206 IN PLUID LogonId 00207 ); 00208 00209 NTSTATUS 00210 SepDeleteLogonSessionTrack( 00211 IN PLUID LogonId 00212 ); 00213 00214 00215 00216 00217 00218 00220 // // 00221 // Reference Monitor Private Variables Declarations // 00222 // These variables are defined in rmvars.c // 00223 // // 00225 00226 extern PEPROCESS SepRmLsaCallProcess; 00227 extern SEP_RM_STATE SepRmState; 00228 extern ERESOURCE SepRmDbLock; 00229 extern PSEP_LOGON_SESSION_REFERENCES *SepLogonSessions;

Generated on Sat May 15 19:41:40 2004 for test by doxygen 1.3.7