ReactOS 0.4.15-dev-5836-g942b022
devicemap.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/ob/devicemap.c
5 * PURPOSE: Device map implementation
6 * PROGRAMMERS: Eric Kohl (eric.kohl@reactos.org)
7 * Alex Ionescu (alex.ionescu@reactos.org)
8 * Pierre Schweitzer (pierre@reactos.org)
9 */
10
11/* INCLUDES ***************************************************************/
12
13#include <ntoskrnl.h>
14#define NDEBUG
15#include <debug.h>
16
19
20/* PRIVATE FUNCTIONS ******************************************************/
21
26{
27 POBJECT_DIRECTORY DirectoryObject = NULL;
28 PDEVICE_MAP DeviceMap = NULL, NewDeviceMap = NULL, OldDeviceMap;
30 PEPROCESS WorkProcess;
31 BOOLEAN MakePermanant = FALSE;
32
37 (PVOID*)&DirectoryObject,
38 NULL);
39 if (!NT_SUCCESS(Status))
40 {
41 DPRINT("ObReferenceObjectByHandle() failed (Status 0x%08lx)\n", Status);
42 return Status;
43 }
44
45 /* Allocate and initialize a new device map */
47 sizeof(*DeviceMap),
48 'mDbO');
49 if (DeviceMap == NULL)
50 {
51 ObDereferenceObject(DirectoryObject);
53 }
54
55 /* Initialize the device map */
56 RtlZeroMemory(DeviceMap, sizeof(*DeviceMap));
57 DeviceMap->ReferenceCount = 1;
58 DeviceMap->DosDevicesDirectory = DirectoryObject;
59
60 /* Acquire the device map lock */
62
63 /* Attach the device map to the directory object */
64 if (DirectoryObject->DeviceMap == NULL)
65 {
66 DirectoryObject->DeviceMap = DeviceMap;
67 }
68 else
69 {
70 NewDeviceMap = DeviceMap;
71
72 /* There's already a device map,
73 so reuse it */
74 DeviceMap = DirectoryObject->DeviceMap;
75 ++DeviceMap->ReferenceCount;
76 }
77
78 /* Caller gave a process, use it */
79 if (Process != NULL)
80 {
81 WorkProcess = Process;
82 }
83 /* If no process given, use current and
84 * set system device map */
85 else
86 {
87 WorkProcess = PsGetCurrentProcess();
88 ObSystemDeviceMap = DeviceMap;
89 }
90
91 /* If current object isn't system one, save system one in current
92 * device map */
93 if (DirectoryObject != ObSystemDeviceMap->DosDevicesDirectory)
94 {
95 /* We also need to make the object permanant */
97 MakePermanant = TRUE;
98 }
99
100 /* Save old process device map */
101 OldDeviceMap = WorkProcess->DeviceMap;
102 /* Attach the device map to the process */
103 WorkProcess->DeviceMap = DeviceMap;
104
105 /* Release the device map lock */
107
108 /* If we have to make the object permamant, do it now */
109 if (MakePermanant)
110 {
111 POBJECT_HEADER ObjectHeader;
112 POBJECT_HEADER_NAME_INFO HeaderNameInfo;
113
114 ObjectHeader = OBJECT_TO_OBJECT_HEADER(DirectoryObject);
115 HeaderNameInfo = ObpReferenceNameInfo(ObjectHeader);
116
117 ObpEnterObjectTypeMutex(ObjectHeader->Type);
118 if (HeaderNameInfo != NULL && HeaderNameInfo->Directory != NULL)
119 {
120 ObjectHeader->Flags |= OB_FLAG_PERMANENT;
121 }
122 ObpLeaveObjectTypeMutex(ObjectHeader->Type);
123
124 if (HeaderNameInfo != NULL)
125 {
126 ObpDereferenceNameInfo(HeaderNameInfo);
127 }
128 }
129
130 /* Release useless device map if required */
131 if (NewDeviceMap != NULL)
132 {
133 ObDereferenceObject(DirectoryObject);
134 ExFreePoolWithTag(NewDeviceMap, 'mDbO');
135 }
136
137 /* And dereference previous process device map */
138 if (OldDeviceMap != NULL)
139 {
140 ObfDereferenceDeviceMap(OldDeviceMap);
141 }
142
143 return STATUS_SUCCESS;
144}
145
146
148NTAPI
151{
152 POBJECT_DIRECTORY DirectoryObject = NULL;
153 PDEVICE_MAP LocalMap = NULL, NewDeviceMap = NULL;
155 POBJECT_HEADER ObjectHeader;
156 POBJECT_HEADER_NAME_INFO HeaderNameInfo;
157
162 (PVOID*)&DirectoryObject,
163 NULL);
164 if (!NT_SUCCESS(Status))
165 {
166 DPRINT("ObReferenceObjectByHandle() failed (Status 0x%08lx)\n", Status);
167 return Status;
168 }
169
170 /* Allocate and initialize a new device map */
172 sizeof(*LocalMap),
173 'mDbO');
174 if (LocalMap == NULL)
175 {
176 ObDereferenceObject(DirectoryObject);
178 }
179
180 /* Initialize the device map */
181 RtlZeroMemory(LocalMap, sizeof(*LocalMap));
182 LocalMap->ReferenceCount = 1;
183 LocalMap->DosDevicesDirectory = DirectoryObject;
184
185 /* Acquire the device map lock */
187
188 /* Attach the device map to the directory object */
189 if (DirectoryObject->DeviceMap == NULL)
190 {
191 DirectoryObject->DeviceMap = LocalMap;
192 }
193 else
194 {
195 NewDeviceMap = LocalMap;
196
197 /* There's already a device map,
198 so reuse it */
199 LocalMap = DirectoryObject->DeviceMap;
200 ++LocalMap->ReferenceCount;
201 }
202
203 /* If current object isn't system one, save system one in current
204 * device map */
205 if (DirectoryObject != ObSystemDeviceMap->DosDevicesDirectory)
206 {
207 /* We also need to make the object permanant */
209 }
210
211 /* Release the device map lock */
213
214 if (DeviceMap != NULL)
215 {
216 *DeviceMap = LocalMap;
217 }
218
219 /* Caller expects us to make the object permanant, so do it! */
220 ObjectHeader = OBJECT_TO_OBJECT_HEADER(DirectoryObject);
221 HeaderNameInfo = ObpReferenceNameInfo(ObjectHeader);
222
223 ObpEnterObjectTypeMutex(ObjectHeader->Type);
224 if (HeaderNameInfo != NULL && HeaderNameInfo->Directory != NULL)
225 {
226 ObjectHeader->Flags |= OB_FLAG_PERMANENT;
227 }
228 ObpLeaveObjectTypeMutex(ObjectHeader->Type);
229
230 if (HeaderNameInfo != NULL)
231 {
232 ObpDereferenceNameInfo(HeaderNameInfo);
233 }
234
235 /* Release useless device map if required */
236 if (NewDeviceMap != NULL)
237 {
238 ObDereferenceObject(DirectoryObject);
239 ExFreePoolWithTag(NewDeviceMap, 'mDbO');
240 }
241
242 return Status;
243}
244
245
247NTAPI
249{
253 PEPROCESS CurrentProcess;
254 LUID SystemLuid = SYSTEM_LUID;
255 PDEVICE_MAP DeviceMap, OldDeviceMap;
256
257 /* Get our impersonation token */
258 CurrentProcess = PsGetCurrentProcess();
259 Token = PsReferencePrimaryToken(CurrentProcess);
260 if (Token == NULL)
261 {
262 return STATUS_NO_TOKEN;
263 }
264
265 /* Query the Logon ID */
267 if (!NT_SUCCESS(Status))
268 {
269 goto done;
270 }
271
272 /* If that's system, then use system device map */
273 if (RtlEqualLuid(&LogonId, &SystemLuid))
274 {
275 DeviceMap = ObSystemDeviceMap;
276 }
277 /* Otherwise ask Se for the device map */
278 else
279 {
280 Status = SeGetLogonIdDeviceMap(&LogonId, &DeviceMap);
281 if (!NT_SUCCESS(Status))
282 {
283 /* Normalize failure status */
285 goto done;
286 }
287 }
288
289 /* Fail if no device map */
290 if (DeviceMap == NULL)
291 {
293 goto done;
294 }
295
296 /* Acquire the device map lock */
298
299 /* Save old device map attached to the process */
300 OldDeviceMap = CurrentProcess->DeviceMap;
301
302 /* Set new device map & reference it */
303 ++DeviceMap->ReferenceCount;
304 CurrentProcess->DeviceMap = DeviceMap;
305
306 /* Release the device map lock */
308
309 /* If we had a device map, dereference it */
310 if (OldDeviceMap != NULL)
311 {
312 ObfDereferenceDeviceMap(OldDeviceMap);
313 }
314
315done:
316 /* We're done with the token! */
318
319 return Status;
320}
321
322
324NTAPI
326{
329 PTOKEN Token = NULL;
330 PDEVICE_MAP DeviceMap;
331 PETHREAD CurrentThread;
332 BOOLEAN LookingForSystem;
333 LUID SystemLuid = SYSTEM_LUID;
336
337 LookingForSystem = FALSE;
338
339 /* If LUID mapping is enable, try to get appropriate device map */
341 {
342 /* In case of impersonation, we've got a bit of work to do */
343 CurrentThread = PsGetCurrentThread();
344 if (CurrentThread->ActiveImpersonationInfo)
345 {
346 /* Get impersonation token */
347 Token = PsReferenceImpersonationToken(CurrentThread,
348 &CopyOnOpen,
351 /* Get logon LUID */
352 if (Token != NULL)
353 {
355 }
356 else
357 {
358 /* Force failure */
360 }
361
362 /* If we got logon LUID */
363 if (NT_SUCCESS(Status))
364 {
365 /*
366 * Check it's not system, system is easy to handle,
367 * we just need to return ObSystemDeviceMap
368 */
369 if (!RtlEqualLuid(&LogonId, &SystemLuid))
370 {
371 /* Ask Se for the device map */
372 Status = SeGetLogonIdDeviceMap(&LogonId, &DeviceMap);
373 if (NT_SUCCESS(Status))
374 {
375 /* Acquire the device map lock */
377
378 /* Reference the device map if any */
379 if (DeviceMap != NULL)
380 {
381 ++DeviceMap->ReferenceCount;
382 }
383
384 /* Release the device map lock */
386
387 /* If we got the device map, we're done! */
388 if (DeviceMap != NULL)
389 {
391
392 return DeviceMap;
393 }
394 }
395 }
396 else
397 {
398 LookingForSystem = TRUE;
399 }
400 }
401 }
402
403 /*
404 * Fall back case of the LUID mapping, make sure there's a
405 * a device map attached to the current process
406 */
407 if (PsGetCurrentProcess()->DeviceMap == NULL &&
409 {
410 /* We may have failed after we got impersonation token */
411 if (Token != NULL)
412 {
414 }
415
416 return NULL;
417 }
418 }
419
420 /* Acquire the device map lock */
422
423 /* If we're looking for system map, use it */
424 if (LookingForSystem)
425 {
426 DeviceMap = ObSystemDeviceMap;
427 }
428 /* Otherwise, use current process device map */
429 else
430 {
431 DeviceMap = PsGetCurrentProcess()->DeviceMap;
432 }
433
434 /* If we got one, reference it */
435 if (DeviceMap != NULL)
436 {
437 ++DeviceMap->ReferenceCount;
438 }
439
440 /* Release the device map lock */
442
443 /* We may have impersonation token (if we failed in impersonation branch) */
444 if (Token != NULL)
445 {
447 }
448
449 /* Return the potentially found device map */
450 return DeviceMap;
451}
452
453
454VOID
455NTAPI
457{
458 PDEVICE_MAP DeviceMap;
459
460 DPRINT("ObDereferenceDeviceMap()\n");
461
462 /* Get the pointer to this process devicemap and reset it
463 holding the device map lock */
465 DeviceMap = Process->DeviceMap;
466 Process->DeviceMap = NULL;
468
469 /* Continue only if there is a device map */
470 if (DeviceMap != NULL)
471 ObfDereferenceDeviceMap(DeviceMap);
472}
473
474
475VOID
478{
479 DPRINT("ObfDereferenceDeviceMap()\n");
480
481 /* Acquire the device map lock */
483
484 /* Decrement the reference counter */
485 DeviceMap->ReferenceCount--;
486 DPRINT("ReferenceCount: %lu\n", DeviceMap->ReferenceCount);
487
488 /* Leave, if there are still references to this device map */
489 if (DeviceMap->ReferenceCount != 0)
490 {
491 /* Release the device map lock and leave */
493 return;
494 }
495
496 /* Nobody is referencing it anymore, unlink the DOS directory */
497 DeviceMap->DosDevicesDirectory->DeviceMap = NULL;
498
499 /* Release the devicemap lock */
501
502 /* Dereference the DOS Devices Directory and free the Device Map */
503 ObMakeTemporaryObject(DeviceMap->DosDevicesDirectory);
504 ObDereferenceObject(DeviceMap->DosDevicesDirectory);
505 ExFreePoolWithTag(DeviceMap, 'mDbO');
506}
507
508
509VOID
510NTAPI
513{
514 PDEVICE_MAP DeviceMap;
515
516 DPRINT("ObInheritDeviceMap()\n");
517
518 /* Acquire the device map lock */
520
521 /* Get the parent process device map or the system device map */
522 DeviceMap = (Parent != NULL) ? Parent->DeviceMap : ObSystemDeviceMap;
523 if (DeviceMap != NULL)
524 {
525 /* Reference the device map and attach it to the new process */
526 DeviceMap->ReferenceCount++;
527 DPRINT("ReferenceCount: %lu\n", DeviceMap->ReferenceCount);
528
529 Process->DeviceMap = DeviceMap;
530 }
531
532 /* Release the device map lock */
534}
535
536
538NTAPI
543{
544 PDEVICE_MAP DeviceMap = NULL, GlobalDeviceMap;
545 BOOLEAN Dereference;
547 ULONG BitMask, i;
548 BOOLEAN ReturnAny;
550
551 /* Validate flags */
553 {
555 }
556
557 Dereference = FALSE;
558 /* Do we want to return anything? */
560
561 /* If LUID mappings are enabled... */
563 {
564 /* Check for process parameter validness */
566 {
568 }
569
570 /* And get the device map */
571 DeviceMap = ObpReferenceDeviceMap();
572 }
573
574 /* Acquire the device map lock */
576
577 /*
578 * If we had a device map, if because of LUID mappings,
579 * we'll have to dereference it afterwards
580 */
581 if (DeviceMap != NULL)
582 {
583 Dereference = TRUE;
584 }
585 else
586 {
587 /* Get the process device map or the system device map */
588 DeviceMap = (Process != NULL) ? Process->DeviceMap : ObSystemDeviceMap;
589 }
590
591 /* Fail if no device map */
592 if (DeviceMap == NULL)
593 {
595 return STATUS_END_OF_FILE;
596 }
597
598 /* At that point, assume success */
600
601 /* Try to get the global device map if any */
602 GlobalDeviceMap = DeviceMap;
603 if (DeviceMap->GlobalDosDevicesDirectory != NULL)
604 {
605 if (DeviceMap->GlobalDosDevicesDirectory->DeviceMap != NULL)
606 {
607 GlobalDeviceMap = DeviceMap->GlobalDosDevicesDirectory->DeviceMap;
608 }
609 }
610
611 /* Now, setup our device map info, especially drive types */
612 MapInfo.Query.DriveMap = DeviceMap->DriveMap;
613 /* Browse every device */
614 for (i = 0, BitMask = 1; i < 32; ++i, BitMask *= 2)
615 {
616 /* Set the type given current device map */
617 MapInfo.Query.DriveType[i] = DeviceMap->DriveType[i];
618
619 /*
620 * If device is not existing and we're asked to return
621 * more than just LUID mapped, get the entry
622 * from global device map if not remote
623 */
624 if (!(MapInfo.Query.DriveMap & BitMask) && ReturnAny)
625 {
626 if (ObpLUIDDeviceMapsEnabled != 0 ||
627 (GlobalDeviceMap->DriveType[i] != DOSDEVICE_DRIVE_REMOTE &&
628 GlobalDeviceMap->DriveType[i] != DOSDEVICE_DRIVE_CALCULATE))
629 {
630 MapInfo.Query.DriveType[i] = GlobalDeviceMap->DriveType[i];
631 MapInfo.Query.DriveMap |= BitMask & GlobalDeviceMap->DriveMap;
632 }
633 }
634 }
635
636 /* Release the device map lock */
638
639 /* Dereference LUID device map */
640 if (Dereference)
641 {
642 ObfDereferenceDeviceMap(DeviceMap);
643 }
644
645 /* Copy back data */
647 {
648 RtlCopyMemory(DeviceMapInfo, &MapInfo, sizeof(PROCESS_DEVICEMAP_INFORMATION));
649 }
651 {
653 }
654 _SEH2_END;
655
656 return Status;
657}
658
659
660ULONG
661NTAPI
663{
665}
666
667
668#if 0
670NTAPI
671ObIsDosDeviceLocallyMapped(
672 IN ULONG Index,
673 OUT PUCHAR DosDeviceState)
674{
675 /* Check the index */
676 if (Index < 1 || Index > 26)
678
679 /* Acquire the device map lock */
681
682 /* Get drive mapping status */
683 *DosDeviceState = (ObSystemDeviceMap->DriveMap & (1 << Index)) != 0;
684
685 /* Release the device map lock */
687
688 return STATUS_SUCCESS;
689}
690#endif
691
692/* EOF */
static HANDLE DirectoryHandle
Definition: ObType.c:48
#define ObpDirectoryObjectType
Definition: ObTypes.c:118
unsigned char BOOLEAN
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:732
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI ObpSetCurrentProcessDeviceMap(VOID)
Definition: devicemap.c:248
PDEVICE_MAP NTAPI ObpReferenceDeviceMap(VOID)
Definition: devicemap.c:325
VOID NTAPI ObInheritDeviceMap(IN PEPROCESS Parent, IN PEPROCESS Process)
Definition: devicemap.c:511
NTSTATUS NTAPI ObSetDirectoryDeviceMap(OUT PDEVICE_MAP *DeviceMap, IN HANDLE DirectoryHandle)
Definition: devicemap.c:149
VOID NTAPI ObDereferenceDeviceMap(IN PEPROCESS Process)
Definition: devicemap.c:456
NTSTATUS NTAPI ObSetDeviceMap(IN PEPROCESS Process, IN HANDLE DirectoryHandle)
Definition: devicemap.c:24
ULONG NTAPI ObIsLUIDDeviceMapsEnabled(VOID)
Definition: devicemap.c:662
NTSTATUS NTAPI ObQueryDeviceMapInformation(_In_opt_ PEPROCESS Process, _Out_ PPROCESS_DEVICEMAP_INFORMATION DeviceMapInfo, _In_ ULONG Flags)
Definition: devicemap.c:539
ULONG ObpLUIDDeviceMapsEnabled
Definition: devicemap.c:18
VOID FASTCALL ObfDereferenceDeviceMap(IN PDEVICE_MAP DeviceMap)
Definition: devicemap.c:477
ULONG ObpLUIDDeviceMapsDisabled
Definition: devicemap.c:17
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PsGetCurrentThread()
Definition: env_spec_w32.h:81
#define PagedPool
Definition: env_spec_w32.h:308
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
Status
Definition: gdiplustypes.h:25
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
VOID FASTCALL KeReleaseGuardedMutex(IN OUT PKGUARDED_MUTEX GuardedMutex)
Definition: gmutex.c:53
VOID FASTCALL KeAcquireGuardedMutex(IN PKGUARDED_MUTEX GuardedMutex)
Definition: gmutex.c:42
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define PROCESS_LUID_DOSDEVICES_ONLY
Definition: pstypes.h:228
if(dx< 0)
Definition: linetemp.h:194
enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define KernelMode
Definition: asm.h:34
#define KeGetPreviousMode()
Definition: ketypes.h:1108
#define OB_FLAG_PERMANENT
Definition: obtypes.h:101
#define DOSDEVICE_DRIVE_CALCULATE
Definition: obtypes.h:164
#define DOSDEVICE_DRIVE_REMOTE
Definition: obtypes.h:167
#define OBJECT_TO_OBJECT_HEADER(o)
Definition: obtypes.h:111
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ BOOLEAN EffectiveOnly
Definition: sefuncs.h:403
#define DIRECTORY_TRAVERSE
Definition: nt_native.h:1255
#define FASTCALL
Definition: nt_native.h:50
_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
NTSTATUS NTAPI SeGetLogonIdDeviceMap(_In_ PLUID LogonId, _Out_ PDEVICE_MAP *DeviceMap)
Retrieves the DOS device map from a logon session.
Definition: srm.c:1347
PACCESS_TOKEN NTAPI PsReferencePrimaryToken(PEPROCESS Process)
Definition: security.c:440
PACCESS_TOKEN NTAPI PsReferenceImpersonationToken(IN PETHREAD Thread, OUT PBOOLEAN CopyOnOpen, OUT PBOOLEAN EffectiveOnly, OUT PSECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
Definition: security.c:849
NTSTATUS NTAPI SeQueryAuthenticationIdToken(_In_ PACCESS_TOKEN Token, _Out_ PLUID LogonId)
Queries the authentication ID of an access token.
Definition: token.c:1823
#define STATUS_NO_TOKEN
Definition: ntstatus.h:360
#define STATUS_OBJECT_PATH_INVALID
Definition: ntstatus.h:293
KGUARDED_MUTEX ObpDeviceMapLock
Definition: oblife.c:24
FORCEINLINE VOID ObpLeaveObjectTypeMutex(IN POBJECT_TYPE ObjectType)
Definition: ob_x.h:352
FORCEINLINE VOID ObpDereferenceNameInfo(IN POBJECT_HEADER_NAME_INFO HeaderNameInfo)
Definition: ob_x.h:143
FORCEINLINE POBJECT_HEADER_NAME_INFO ObpReferenceNameInfo(IN POBJECT_HEADER ObjectHeader)
Definition: ob_x.h:102
FORCEINLINE VOID ObpEnterObjectTypeMutex(IN POBJECT_TYPE ObjectType)
Definition: ob_x.h:340
PDEVICE_MAP ObSystemDeviceMap
Definition: obinit.c:46
VOID NTAPI ObMakeTemporaryObject(IN PVOID ObjectBody)
Definition: oblife.c:1361
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:494
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:159
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
#define STATUS_END_OF_FILE
Definition: shellext.h:67
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
UCHAR DriveType[32]
Definition: obtypes.h:529
ULONG ReferenceCount
Definition: obtypes.h:527
POBJECT_DIRECTORY DosDevicesDirectory
Definition: obtypes.h:525
POBJECT_DIRECTORY GlobalDosDevicesDirectory
Definition: obtypes.h:526
ULONG DriveMap
Definition: obtypes.h:528
PVOID DeviceMap
Definition: pstypes.h:1313
ULONG ActiveImpersonationInfo
Definition: pstypes.h:1181
struct _DEVICE_MAP * DeviceMap
Definition: obtypes.h:418
POBJECT_DIRECTORY Directory
Definition: obtypes.h:432
UCHAR Flags
Definition: obtypes.h:497
POBJECT_TYPE Type
Definition: obtypes.h:493
struct _PROCESS_DEVICEMAP_INFORMATION::@3965::@3967 Query
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define ObDereferenceObject
Definition: obfuncs.h:203
_Out_ PBOOLEAN CopyOnOpen
Definition: psfuncs.h:154
#define PsGetCurrentProcess
Definition: psfuncs.h:17
_Out_ PBOOLEAN _Out_ PBOOLEAN _Out_ PSECURITY_IMPERSONATION_LEVEL ImpersonationLevel
Definition: psfuncs.h:156
#define RtlEqualLuid(Luid1, Luid2)
Definition: rtlfuncs.h:301
#define SYSTEM_LUID
Definition: setypes.h:700