ReactOS 0.4.16-dev-297-gc569aee
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}
#define NULL
Definition: types.h:112
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
#define ASSERT(a)
Definition: mode.c:44

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 */
38 Process->VdmObjects = NULL;
39}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
#define TAG_KERNEL
Definition: tag.h:42

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 */
62 {
63 /* Get the descriptor */
64 RtlCopyMemory(&DescriptorEntry,
65 ThreadInformation,
66 sizeof(DESCRIPTOR_TABLE_ENTRY));
67 }
69 {
70 /* Return the exception code */
72 }
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 */
86 {
87 /* Copy the GDT entry to caller */
88 RtlCopyMemory(&((PDESCRIPTOR_TABLE_ENTRY)ThreadInformation)->
91 sizeof(LDT_ENTRY));
92 if (ReturnLength) *ReturnLength = sizeof(LDT_ENTRY);
93 }
95 {
96 /* Return the exception code */
98 }
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}
#define PAGED_CODE()
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:43
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
Status
Definition: gdiplustypes.h:25
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define LDT_ENTRY
Definition: ketypes.h:289
_In_ THREADINFOCLASS _In_ ULONG ThreadInformationLength
Definition: psfuncs.h:843
NTSTATUS NTAPI Ke386GetGdtEntryThread(IN PKTHREAD Thread, IN ULONG Offset, IN PKGDTENTRY Descriptor)
Definition: ldt.c:26
#define STATUS_NO_LDT
Definition: ntstatus.h:515
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define _SEH2_END
Definition: pseh2_64.h:155
#define _SEH2_TRY
Definition: pseh2_64.h:55
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:168
#define STATUS_SUCCESS
Definition: shellext.h:65
KTHREAD Tcb
Definition: pstypes.h:1104
Definition: compat.h:777
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342

Referenced by NtQueryInformationThread().