ReactOS  0.4.14-dev-297-g23e575c
psldt.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
Include dependency graph for psldt.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI PspDeleteLdt (PEPROCESS Process)
 
VOID NTAPI PspDeleteVdmObjects (PEPROCESS Process)
 
NTSTATUS NTAPI PspQueryDescriptorThread (IN PETHREAD Thread, IN PVOID ThreadInformation, IN ULONG ThreadInformationLength, OUT PULONG ReturnLength OPTIONAL)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file psldt.c.

Function Documentation

◆ PspDeleteLdt()

VOID NTAPI PspDeleteLdt ( PEPROCESS  Process)

Definition at line 19 of file psldt.c.

20 {
21  /* FIXME - LdtInformation must be null as long as we don't implement VDMs */
22  ASSERT(Process->LdtInformation == NULL);
23 }
smooth NULL
Definition: ftsmooth.c:416
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219

Referenced by PspDeleteProcess().

◆ PspDeleteVdmObjects()

VOID NTAPI PspDeleteVdmObjects ( PEPROCESS  Process)

Definition at line 27 of file psldt.c.

28 {
29  /* If there are no VDM objects, just exit */
30  if (Process->VdmObjects == NULL)
31  return;
32 
33  /* FIXME: Need to do more than just freeing the main VdmObjects member! */
35 
36  /* Free VDM objects */
37  ExFreePoolWithTag(Process->VdmObjects, ' eK');
38  Process->VdmObjects = NULL;
39 }
smooth NULL
Definition: ftsmooth.c:416
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
#define UNIMPLEMENTED
Definition: debug.h:114
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

Referenced by PspDeleteProcess().

◆ PspQueryDescriptorThread()

NTSTATUS NTAPI PspQueryDescriptorThread ( IN PETHREAD  Thread,
IN PVOID  ThreadInformation,
IN ULONG  ThreadInformationLength,
OUT PULONG ReturnLength  OPTIONAL 
)

Definition at line 43 of file psldt.c.

47 {
48  DESCRIPTOR_TABLE_ENTRY DescriptorEntry;
51  PAGED_CODE();
52 
53  /* Verify the size */
54  if (ThreadInformationLength != sizeof(DESCRIPTOR_TABLE_ENTRY))
55  {
56  /* Fail */
58  }
59 
60  /* Enter SEH for the copy */
61  _SEH2_TRY
62  {
63  /* Get the descriptor */
64  RtlCopyMemory(&DescriptorEntry,
65  ThreadInformation,
66  sizeof(DESCRIPTOR_TABLE_ENTRY));
67  }
69  {
70  /* Return the exception code */
72  }
73  _SEH2_END;
74 
75  /* Check if this is a GDT selector */
76  if (!(DescriptorEntry.Selector & 0x4))
77  {
78  /* Get the GDT entry */
80  DescriptorEntry.Selector & 0xFFFFFFF8,
82  if (!NT_SUCCESS(Status)) return Status;
83 
84  /* Enter SEH for the copy */
85  _SEH2_TRY
86  {
87  /* Copy the GDT entry to caller */
88  RtlCopyMemory(&((PDESCRIPTOR_TABLE_ENTRY)ThreadInformation)->
89  Descriptor,
90  &Descriptor,
91  sizeof(LDT_ENTRY));
92  if (ReturnLength) *ReturnLength = sizeof(LDT_ENTRY);
93  }
95  {
96  /* Return the exception code */
98  }
99  _SEH2_END;
100 
101  /* Success */
103  }
104  else
105  {
106  /* This is only supported for VDM, which we don't implement */
107  ASSERT(Thread->ThreadsProcess->LdtInformation == NULL);
109  }
110 
111  /* Return status to caller */
112  return Status;
113 }
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
#define LDT_ENTRY
Definition: ketypes.h:291
LONG NTSTATUS
Definition: precomp.h:26
KTHREAD Tcb
Definition: pstypes.h:1034
#define PAGED_CODE()
Definition: video.h:57
_SEH2_TRY
Definition: create.c:4250
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define STATUS_NO_LDT
Definition: ntstatus.h:501
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
NTSTATUS NTAPI Ke386GetGdtEntryThread(IN PKTHREAD Thread, IN ULONG Offset, IN PKGDTENTRY Descriptor)
Definition: ldt.c:26
Status
Definition: gdiplustypes.h:24
Definition: compat.h:428
_SEH2_END
Definition: create.c:4424
_In_ THREADINFOCLASS _In_ ULONG ThreadInformationLength
Definition: psfuncs.h:835
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
return STATUS_SUCCESS
Definition: btrfs.c:2966
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966

Referenced by NtQueryInformationThread().