ReactOS  0.4.14-dev-57-g333b8f1
session.c
Go to the documentation of this file.
1 /*
2  * PROJECT: Local Security Authority Server DLL
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: dll/win32/lsasrv/session.c
5  * PURPOSE: Logon session management routines
6  * COPYRIGHT: Copyright 2013 Eric Kohl
7  */
8 
9 #include "lsasrv.h"
10 
11 typedef struct _LSAP_LOGON_SESSION
12 {
26 
27 
28 /* GLOBALS *****************************************************************/
29 
32 
33 /* FUNCTIONS ***************************************************************/
34 
35 VOID
37 {
39  SessionCount = 0;
40 }
41 
42 
43 static
46 {
47  PLIST_ENTRY SessionEntry;
48  PLSAP_LOGON_SESSION CurrentSession;
49 
50  SessionEntry = SessionListHead.Flink;
51  while (SessionEntry != &SessionListHead)
52  {
53  CurrentSession = CONTAINING_RECORD(SessionEntry,
55  Entry);
56  if (RtlEqualLuid(&CurrentSession->LogonId, LogonId))
57  return CurrentSession;
58 
59  SessionEntry = SessionEntry->Flink;
60  }
61 
62  return NULL;
63 }
64 
65 
70  _In_ PUNICODE_STRING UserName,
71  _In_ PUNICODE_STRING LogonDomain,
72  _In_ PSID Sid)
73 {
74  PLSAP_LOGON_SESSION Session;
75  ULONG Length;
76 
77  TRACE("LsapSetLogonSessionData(%p)\n", LogonId);
78 
79  Session = LsapGetLogonSession(LogonId);
80  if (Session == NULL)
82 
83  TRACE("LogonType %lu\n", LogonType);
84  Session->LogonType = LogonType;
85 
86  TRACE("UserName %wZ\n", UserName);
87  Session->UserName.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, UserName->MaximumLength);
88  if (Session->UserName.Buffer == NULL)
90 
91  Session->UserName.Length = UserName->Length;
92  Session->UserName.MaximumLength = UserName->MaximumLength;
93  RtlCopyMemory(Session->UserName.Buffer, UserName->Buffer, UserName->MaximumLength);
94 
95  TRACE("LogonDomain %wZ\n", LogonDomain);
96  Session->LogonDomain.Buffer = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, LogonDomain->MaximumLength);
97  if (Session->LogonDomain.Buffer == NULL)
99 
100  Session->LogonDomain.Length = LogonDomain->Length;
101  Session->LogonDomain.MaximumLength = LogonDomain->MaximumLength;
102  RtlCopyMemory(Session->LogonDomain.Buffer, LogonDomain->Buffer, LogonDomain->MaximumLength);
103 
105  Session->Sid = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, Length);
106  if (Session->UserName.Buffer == NULL)
108 
109  RtlCopyMemory(Session->Sid, Sid, Length);
110 
111  return STATUS_SUCCESS;
112 }
113 
114 
115 NTSTATUS
116 NTAPI
118 {
119  PLSAP_LOGON_SESSION Session;
121 
122  TRACE("LsapCreateLogonSession(%p)\n", LogonId);
123 
124  /* Fail, if a session already exists */
127 
128  /* Allocate a new session entry */
129  Session = RtlAllocateHeap(RtlGetProcessHeap(),
131  sizeof(LSAP_LOGON_SESSION));
132  if (Session == NULL)
134 
135  /* Initialize the session entry */
136  RtlCopyLuid(&Session->LogonId, LogonId);
137 
138  TRACE("LsapCreateLogonSession(<0x%lx,0x%lx>)\n",
139  LogonId->HighPart, LogonId->LowPart);
140 
141  /* Tell ntoskrnl to create a new logon session */
143  if (!NT_SUCCESS(Status))
144  {
145  RtlFreeHeap(RtlGetProcessHeap(), 0, Session);
146  return Status;
147  }
148 
149  /* Insert the new session into the session list */
150  InsertHeadList(&SessionListHead, &Session->Entry);
151  SessionCount++;
152 
153  return STATUS_SUCCESS;
154 }
155 
156 
157 NTSTATUS
158 NTAPI
160 {
161  PLSAP_LOGON_SESSION Session;
163 
164  TRACE("LsapDeleteLogonSession(%p)\n", LogonId);
165 
166  /* Fail, if the session does not exist */
167  Session = LsapGetLogonSession(LogonId);
168  if (Session == NULL)
170 
171  TRACE("LsapDeleteLogonSession(<0x%lx,0x%lx>)\n",
172  LogonId->HighPart, LogonId->LowPart);
173 
174  /* Tell ntoskrnl to delete the logon session */
176  if (!NT_SUCCESS(Status))
177  return Status;
178 
179  /* Remove the session entry from the list */
180  RemoveEntryList(&Session->Entry);
181  SessionCount--;
182 
183  /* Free the session data */
184  if (Session->Sid != NULL)
185  RtlFreeHeap(RtlGetProcessHeap(), 0, Session->Sid);
186 
187  if (Session->UserName.Buffer != NULL)
188  RtlFreeHeap(RtlGetProcessHeap(), 0, Session->UserName.Buffer);
189 
190  if (Session->LogonDomain.Buffer != NULL)
191  RtlFreeHeap(RtlGetProcessHeap(), 0, Session->LogonDomain.Buffer);
192 
193  if (Session->AuthenticationPackage.Buffer != NULL)
194  RtlFreeHeap(RtlGetProcessHeap(), 0, Session->AuthenticationPackage.Buffer);
195 
196  if (Session->LogonServer.Buffer != NULL)
197  RtlFreeHeap(RtlGetProcessHeap(), 0, Session->LogonServer.Buffer);
198 
199  if (Session->DnsDomainName.Buffer != NULL)
200  RtlFreeHeap(RtlGetProcessHeap(), 0, Session->DnsDomainName.Buffer);
201 
202  if (Session->Upn.Buffer != NULL)
203  RtlFreeHeap(RtlGetProcessHeap(), 0, Session->Upn.Buffer);
204 
205  /* Free the session entry */
206  RtlFreeHeap(RtlGetProcessHeap(), 0, Session);
207 
208  return STATUS_SUCCESS;
209 }
210 
211 
212 NTSTATUS
213 NTAPI
217  _In_ PLSA_STRING PrimaryKeyValue,
218  _In_ PLSA_STRING Credential)
219 {
220 
221  return STATUS_SUCCESS;
222 }
223 
224 
225 NTSTATUS
226 NTAPI
230  _Inout_ PULONG QueryContext,
231  _In_ BOOLEAN RetrieveAllCredentials,
232  _Inout_ PLSA_STRING PrimaryKeyValue,
233  _Out_ PULONG PrimaryKeyLength,
234  _Out_ PLSA_STRING Credentials)
235 {
236 
237  return STATUS_SUCCESS;
238 }
239 
240 
241 NTSTATUS
242 NTAPI
246  _In_ PLSA_STRING PrimaryKeyValue)
247 {
248 
249  return STATUS_SUCCESS;
250 }
251 
252 
253 NTSTATUS
255 {
258  PLIST_ENTRY SessionEntry;
259  PLSAP_LOGON_SESSION CurrentSession;
260  PLUID SessionList;
261  ULONG i, Length;
262  SIZE_T MemSize;
263  PVOID ClientBaseAddress = NULL;
265 
266  TRACE("LsapEnumLogonSessions(%p)\n", RequestMsg);
267 
268  Length = SessionCount * sizeof(LUID);
269  SessionList = RtlAllocateHeap(RtlGetProcessHeap(),
271  Length);
272  if (SessionList == NULL)
274 
275  i = 0;
276  SessionEntry = SessionListHead.Flink;
277  while (SessionEntry != &SessionListHead)
278  {
279  CurrentSession = CONTAINING_RECORD(SessionEntry,
281  Entry);
282 
283  RtlCopyLuid(&SessionList[i],
284  &CurrentSession->LogonId);
285 
286  SessionEntry = SessionEntry->Flink;
287  i++;
288  }
289 
291  NULL,
292  0,
293  NULL,
294  NULL);
295 
299  &RequestMsg->h.ClientId);
300  if (!NT_SUCCESS(Status))
301  {
302  TRACE("NtOpenProcess() failed (Status %lx)\n", Status);
303  goto done;
304  }
305 
306  TRACE("Length: %lu\n", Length);
307 
308  MemSize = Length;
310  &ClientBaseAddress,
311  0,
312  &MemSize,
313  MEM_COMMIT,
315  if (!NT_SUCCESS(Status))
316  {
317  TRACE("NtAllocateVirtualMemory() failed (Status %lx)\n", Status);
318  goto done;
319  }
320 
321  TRACE("MemSize: %lu\n", MemSize);
322  TRACE("ClientBaseAddress: %p\n", ClientBaseAddress);
323 
325  ClientBaseAddress,
326  SessionList,
327  Length,
328  NULL);
329  if (!NT_SUCCESS(Status))
330  {
331  TRACE("NtWriteVirtualMemory() failed (Status %lx)\n", Status);
332  goto done;
333  }
334 
335  RequestMsg->EnumLogonSessions.Reply.LogonSessionCount = SessionCount;
336  RequestMsg->EnumLogonSessions.Reply.LogonSessionBuffer = ClientBaseAddress;
337 
338 done:
339  if (ProcessHandle != NULL)
341 
342  if (SessionList != NULL)
343  RtlFreeHeap(RtlGetProcessHeap(), 0, SessionList);
344 
345  return Status;
346 }
347 
348 
349 NTSTATUS
351 {
354  PLSAP_LOGON_SESSION Session;
355  PSECURITY_LOGON_SESSION_DATA LocalSessionData;
356  PVOID ClientBaseAddress = NULL;
357  ULONG TotalLength, SidLength = 0;
358  SIZE_T MemSize;
359  PUCHAR Ptr;
361 
362  TRACE("LsapGetLogonSessionData(%p)\n", RequestMsg);
363 
364  TRACE("LogonId: %lx\n", RequestMsg->GetLogonSessionData.Request.LogonId.LowPart);
365  Session = LsapGetLogonSession(&RequestMsg->GetLogonSessionData.Request.LogonId);
366  if (Session == NULL)
368 
369  /* Calculate the required buffer size */
371  Session->UserName.MaximumLength +
372  Session->LogonDomain.MaximumLength +
374  Session->LogonServer.MaximumLength +
375  Session->DnsDomainName.MaximumLength +
376  Session->Upn.MaximumLength;
377  if (Session->Sid != NULL)
378  {
379  SidLength = RtlLengthSid(Session->Sid);
380  TotalLength += SidLength;
381  }
382  TRACE("TotalLength: %lu\n", TotalLength);
383 
384  /* Allocate the buffer */
385  LocalSessionData = RtlAllocateHeap(RtlGetProcessHeap(),
387  TotalLength);
388  if (LocalSessionData == NULL)
390 
391  Ptr = (PUCHAR)((ULONG_PTR)LocalSessionData + sizeof(SECURITY_LOGON_SESSION_DATA));
392  TRACE("LocalSessionData: %p Ptr: %p\n", LocalSessionData, Ptr);
393 
394  LocalSessionData->Size = sizeof(SECURITY_LOGON_SESSION_DATA);
395 
396  /* Copy the LogonId */
397  RtlCopyLuid(&LocalSessionData->LogonId,
398  &RequestMsg->GetLogonSessionData.Request.LogonId);
399 
400  /* Copy the UserName string*/
401  LocalSessionData->UserName.Length = Session->UserName.Length;
402  LocalSessionData->UserName.MaximumLength = Session->UserName.MaximumLength;
403 
404  if (Session->UserName.MaximumLength != 0)
405  {
406  RtlCopyMemory(Ptr, Session->UserName.Buffer, Session->UserName.MaximumLength);
407  LocalSessionData->UserName.Buffer = (PWSTR)((ULONG_PTR)Ptr - (ULONG_PTR)LocalSessionData);
408 
409  Ptr = (PUCHAR)((ULONG_PTR)Ptr + Session->UserName.MaximumLength);
410  }
411 
412  /* Copy the LogonDomain string */
413  LocalSessionData->LogonDomain.Length = Session->LogonDomain.Length;
414  LocalSessionData->LogonDomain.MaximumLength = Session->LogonDomain.MaximumLength;
415  if (Session->LogonDomain.MaximumLength != 0)
416  {
418  LocalSessionData->LogonDomain.Buffer = (PWSTR)((ULONG_PTR)Ptr - (ULONG_PTR)LocalSessionData);
419 
420  Ptr = (PUCHAR)((ULONG_PTR)Ptr + Session->LogonDomain.MaximumLength);
421  }
422 
423  /* Copy the AuthenticationPackage string */
424  LocalSessionData->AuthenticationPackage.Length = Session->AuthenticationPackage.Length;
426  if (Session->AuthenticationPackage.MaximumLength != 0)
427  {
429  LocalSessionData->AuthenticationPackage.Buffer = (PWSTR)((ULONG_PTR)Ptr - (ULONG_PTR)LocalSessionData);
430 
432  }
433 
434  LocalSessionData->LogonType = Session->LogonType;
435  LocalSessionData->Session = 0;
436 
437  /* Sid */
438  if (Session->Sid != NULL)
439  {
440  RtlCopyMemory(Ptr, Session->Sid, SidLength);
441  LocalSessionData->Sid = (PSID)((ULONG_PTR)Ptr - (ULONG_PTR)LocalSessionData);
442 
443  Ptr = (PUCHAR)((ULONG_PTR)Ptr + SidLength);
444  }
445 
446  /* LogonTime */
447  LocalSessionData->LogonTime.QuadPart = Session->LogonTime.QuadPart;
448 
449  /* Copy the LogonServer string */
450  LocalSessionData->LogonServer.Length = Session->LogonServer.Length;
451  LocalSessionData->LogonServer.MaximumLength = Session->LogonServer.MaximumLength;
452  if (Session->LogonServer.MaximumLength != 0)
453  {
455  LocalSessionData->LogonServer.Buffer = (PWSTR)((ULONG_PTR)Ptr - (ULONG_PTR)LocalSessionData);
456 
457  Ptr = (PUCHAR)((ULONG_PTR)Ptr + Session->LogonServer.MaximumLength);
458  }
459 
460  /* Copy the DnsDomainName string */
461  LocalSessionData->DnsDomainName.Length = Session->DnsDomainName.Length;
462  LocalSessionData->DnsDomainName.MaximumLength = Session->DnsDomainName.MaximumLength;
463  if (Session->DnsDomainName.MaximumLength != 0)
464  {
466  LocalSessionData->DnsDomainName.Buffer = (PWSTR)((ULONG_PTR)Ptr - (ULONG_PTR)LocalSessionData);
467 
469  }
470 
471  /* Copy the Upn string */
472  LocalSessionData->Upn.Length = Session->Upn.Length;
473  LocalSessionData->Upn.MaximumLength = Session->Upn.MaximumLength;
474  if (Session->Upn.MaximumLength != 0)
475  {
476  RtlCopyMemory(Ptr, Session->Upn.Buffer, Session->Upn.MaximumLength);
477  LocalSessionData->Upn.Buffer = (PWSTR)((ULONG_PTR)Ptr - (ULONG_PTR)LocalSessionData);
478 
479  Ptr = (PUCHAR)((ULONG_PTR)Ptr + Session->Upn.MaximumLength);
480  }
481 
482 
484  NULL,
485  0,
486  NULL,
487  NULL);
488 
492  &RequestMsg->h.ClientId);
493  if (!NT_SUCCESS(Status))
494  {
495  TRACE("NtOpenProcess() failed (Status %lx)\n", Status);
496  goto done;
497  }
498 
499  MemSize = TotalLength;
501  &ClientBaseAddress,
502  0,
503  &MemSize,
504  MEM_COMMIT,
506  if (!NT_SUCCESS(Status))
507  {
508  TRACE("NtAllocateVirtualMemory() failed (Status %lx)\n", Status);
509  goto done;
510  }
511 
512  TRACE("MemSize: %lu\n", MemSize);
513  TRACE("ClientBaseAddress: %p\n", ClientBaseAddress);
514 
516  ClientBaseAddress,
517  LocalSessionData,
518  TotalLength,
519  NULL);
520  if (!NT_SUCCESS(Status))
521  {
522  TRACE("NtWriteVirtualMemory() failed (Status %lx)\n", Status);
523  goto done;
524  }
525 
526  RequestMsg->GetLogonSessionData.Reply.SessionDataBuffer = ClientBaseAddress;
527 
528 done:
529  if (ProcessHandle != NULL)
531 
532  if (LocalSessionData != NULL)
533  RtlFreeHeap(RtlGetProcessHeap(), 0, LocalSessionData);
534 
535  return Status;
536 }
537 
538 /* EOF */
NTSTATUS LsapEnumLogonSessions(IN OUT PLSA_API_MSG RequestMsg)
Definition: session.c:254
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
struct _LSAP_LOGON_SESSION LSAP_LOGON_SESSION
#define IN
Definition: typedefs.h:38
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_LOGON_SESSION_COLLISION
Definition: ntstatus.h:483
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
USHORT MaximumLength
Definition: env_spec_w32.h:370
struct _SECURITY_LOGON_SESSION_DATA SECURITY_LOGON_SESSION_DATA
#define STATUS_NO_SUCH_LOGON_SESSION
Definition: ntstatus.h:317
NTSTATUS NTAPI LsapAddCredential(_In_ PLUID LogonId, _In_ ULONG AuthenticationPackage, _In_ PLSA_STRING PrimaryKeyValue, _In_ PLSA_STRING Credential)
Definition: session.c:214
uint16_t * PWSTR
Definition: typedefs.h:54
FORCEINLINE VOID InsertHeadList(_Inout_ PLIST_ENTRY ListHead, _Inout_ __drv_aliasesMem PLIST_ENTRY Entry)
Definition: rtlfuncs.h:201
static PLSAP_LOGON_SESSION LsapGetLogonSession(IN PLUID LogonId)
Definition: session.c:45
unsigned char * PUCHAR
Definition: retypes.h:3
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
NTSTATUS LsapGetLogonSessionData(IN OUT PLSA_API_MSG RequestMsg)
Definition: session.c:350
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
UNICODE_STRING UserName
Definition: session.c:19
UNICODE_STRING LogonServer
Definition: session.c:22
_In_ ULONG TotalLength
Definition: usbdlib.h:145
NTSYSAPI void WINAPI RtlCopyLuid(PLUID, const LUID *)
#define MEM_COMMIT
Definition: nt_native.h:1313
UNICODE_STRING LogonDomain
Definition: session.c:20
NTSTATUS NTAPI NtOpenProcess(OUT PHANDLE ProcessHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN PCLIENT_ID ClientId)
Definition: process.c:1440
NTSTATUS NTAPI LsapCreateLogonSession(IN PLUID LogonId)
Definition: session.c:117
UNICODE_STRING AuthenticationPackage
Definition: session.c:21
uint32_t ULONG_PTR
Definition: typedefs.h:63
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
struct _LUID LUID
NTSTATUS LsapSetLogonSessionData(_In_ PLUID LogonId, _In_ ULONG LogonType, _In_ PUNICODE_STRING UserName, _In_ PUNICODE_STRING LogonDomain, _In_ PSID Sid)
Definition: session.c:67
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
NTSTATUS LsapRmDeleteLogonSession(PLUID LogonId)
Definition: srm.c:285
#define RtlEqualLuid(Luid1, Luid2)
Definition: rtlfuncs.h:301
NTSTATUS LsapRmCreateLogonSession(PLUID LogonId)
Definition: srm.c:245
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define _Out_
Definition: no_sal2.h:323
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1104
NTSYSAPI ULONG NTAPI RtlLengthSid(IN PSID Sid)
Definition: sid.c:150
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define TRACE(s)
Definition: solgame.cpp:4
#define PROCESS_VM_WRITE
Definition: pstypes.h:154
VOID LsapInitLogonSessions(VOID)
Definition: session.c:36
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
UNICODE_STRING DnsDomainName
Definition: session.c:23
#define _Inout_
Definition: no_sal2.h:244
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3399
struct _SID * PSID
Definition: eventlog.c:35
LIST_ENTRY SessionListHead
Definition: session.c:30
LSA_UNICODE_STRING LogonDomain
Definition: ntsecapi.h:304
LSA_UNICODE_STRING DnsDomainName
Definition: ntsecapi.h:311
ULONG AuthenticationPackage
Definition: logon.c:18
Definition: typedefs.h:117
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI LsapDeleteCredential(_In_ PLUID LogonId, _In_ ULONG AuthenticationPackage, _In_ PLSA_STRING PrimaryKeyValue)
Definition: session.c:243
#define _In_
Definition: no_sal2.h:204
UNICODE_STRING Upn
Definition: session.c:24
ULONG_PTR SIZE_T
Definition: typedefs.h:78
NTSTATUS NTAPI NtAllocateVirtualMemory(IN HANDLE ProcessHandle, IN OUT PVOID *UBaseAddress, IN ULONG_PTR ZeroBits, IN OUT PSIZE_T URegionSize, IN ULONG AllocationType, IN ULONG Protect)
Definition: virtual.c:4367
LSA_UNICODE_STRING LogonServer
Definition: ntsecapi.h:310
USHORT MaximumLength
Definition: ntsecapi.h:164
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE LogonType
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
LARGE_INTEGER LogonTime
Definition: session.c:17
unsigned int * PULONG
Definition: retypes.h:1
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID LogonId
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define PROCESS_VM_READ
Definition: pstypes.h:153
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
#define ULONG_PTR
Definition: config.h:101
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define PROCESS_VM_OPERATION
Definition: pstypes.h:152
LSA_UNICODE_STRING AuthenticationPackage
Definition: ntsecapi.h:305
NTSTATUS NTAPI LsapGetCredentials(_In_ PLUID LogonId, _In_ ULONG AuthenticationPackage, _Inout_ PULONG QueryContext, _In_ BOOLEAN RetrieveAllCredentials, _Inout_ PLSA_STRING PrimaryKeyValue, _Out_ PULONG PrimaryKeyLength, _Out_ PLSA_STRING Credentials)
Definition: session.c:227
_In_ HANDLE ProcessHandle
Definition: mmfuncs.h:403
LSA_UNICODE_STRING Upn
Definition: ntsecapi.h:312
NTSTATUS NTAPI NtWriteVirtualMemory(IN HANDLE ProcessHandle, IN PVOID BaseAddress, IN PVOID Buffer, IN SIZE_T NumberOfBytesToWrite, OUT PSIZE_T NumberOfBytesWritten OPTIONAL)
Definition: virtual.c:2805
return STATUS_SUCCESS
Definition: btrfs.c:2966
ULONG SessionCount
Definition: session.c:31
LIST_ENTRY Entry
Definition: session.c:13
base of all file and directory entries
Definition: entries.h:82
LSA_UNICODE_STRING UserName
Definition: ntsecapi.h:303
NTSTATUS NTAPI LsapDeleteLogonSession(IN PLUID LogonId)
Definition: session.c:159
struct _LSAP_LOGON_SESSION * PLSAP_LOGON_SESSION
LONGLONG QuadPart
Definition: typedefs.h:112
#define PAGE_READWRITE
Definition: nt_native.h:1304