[NDK]: Document RtlPushFrame, RtlPopFrame, RtlGetFrame.

[NDK]: Add TEB_ACTIVE_FRAME_CONTEXT_FLAG_EXTENDED, TEB_ACTIVE_FRAME_EX, TEB_ACTIVE_FRAME_CONTEXT_EX from the CoreCLR sources (clrnt.h)
[RTL]: Implement RtlPushFrame, RtlPopFrame, RtlGetFrame.
[NTDLL]: Export the above.
[RTL]: Fix MSVC warning after someone's earlier WINE merge.

svn path=/trunk/; revision=70483
This commit is contained in:
Alex Ionescu 2016-01-03 16:23:38 +00:00
parent de7d65388d
commit b8e0613a39
6 changed files with 108 additions and 6 deletions

View file

@ -655,7 +655,7 @@
653 stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr)
654 stdcall RtlGetElementGenericTable(ptr long)
655 stdcall RtlGetElementGenericTableAvl(ptr long)
# stdcall RtlGetFrame
656 stdcall RtlGetFrame()
657 stdcall RtlGetFullPathName_U(wstr long ptr ptr)
658 stdcall RtlGetFullPathName_UstrEx(ptr ptr ptr ptr ptr ptr ptr ptr)
659 stdcall RtlGetGroupSecurityDescriptor(ptr ptr ptr)
@ -797,11 +797,11 @@
792 stdcall RtlOpenCurrentUser(long ptr)
793 stdcall RtlPcToFileHeader(ptr ptr)
794 stdcall RtlPinAtomInAtomTable(ptr long)
# stdcall RtlPopFrame
795 stdcall RtlPopFrame(ptr)
796 stdcall RtlPrefixString(ptr ptr long)
797 stdcall RtlPrefixUnicodeString(ptr ptr long)
798 stdcall RtlProtectHeap(ptr long)
# stdcall RtlPushFrame
799 stdcall RtlPushFrame(ptr)r
800 stdcall RtlQueryAtomInAtomTable(ptr long ptr ptr ptr ptr)
801 stdcall RtlQueryDepthSList(ptr)
802 stdcall RtlQueryEnvironmentVariable_U(ptr ptr ptr)

View file

@ -182,6 +182,11 @@ extern POBJECT_TYPE NTSYSAPI PsJobType;
//
#define TLS_MINIMUM_AVAILABLE 64
//
// TEB Active Frame Flags
//
#define TEB_ACTIVE_FRAME_CONTEXT_FLAG_EXTENDED 0x1
//
// Job Access Types
//
@ -684,13 +689,29 @@ typedef struct _TEB_ACTIVE_FRAME_CONTEXT
ULONG Flags;
LPSTR FrameName;
} TEB_ACTIVE_FRAME_CONTEXT, *PTEB_ACTIVE_FRAME_CONTEXT;
typedef const struct _TEB_ACTIVE_FRAME_CONTEXT *PCTEB_ACTIVE_FRAME_CONTEXT;
typedef struct _TEB_ACTIVE_FRAME_CONTEXT_EX
{
TEB_ACTIVE_FRAME_CONTEXT BasicContext;
PCSTR SourceLocation;
} TEB_ACTIVE_FRAME_CONTEXT_EX, *PTEB_ACTIVE_FRAME_CONTEXT_EX;
typedef const struct _TEB_ACTIVE_FRAME_CONTEXT_EX *PCTEB_ACTIVE_FRAME_CONTEXT_EX;
typedef struct _TEB_ACTIVE_FRAME
{
ULONG Flags;
struct _TEB_ACTIVE_FRAME *Previous;
PTEB_ACTIVE_FRAME_CONTEXT Context;
PCTEB_ACTIVE_FRAME_CONTEXT Context;
} TEB_ACTIVE_FRAME, *PTEB_ACTIVE_FRAME;
typedef const struct _TEB_ACTIVE_FRAME *PCTEB_ACTIVE_FRAME;
typedef struct _TEB_ACTIVE_FRAME_EX
{
TEB_ACTIVE_FRAME BasicFrame;
PVOID ExtensionIdentifier;
} TEB_ACTIVE_FRAME_EX, *PTEB_ACTIVE_FRAME_EX;
typedef const struct _TEB_ACTIVE_FRAME_EX *PCTEB_ACTIVE_FRAME_EX;
typedef struct _CLIENT_ID32
{

View file

@ -3006,6 +3006,30 @@ RtlGetCompressionWorkSpaceSize(
_Out_ PULONG CompressFragmentWorkSpaceSize
);
//
// Frame Functions
//
NTSYSAPI
VOID
NTAPI
RtlPopFrame(
_In_ PTEB_ACTIVE_FRAME Frame
);
NTSYSAPI
VOID
NTAPI
RtlPushFrame(
_In_ PTEB_ACTIVE_FRAME Frame
);
NTSYSAPI
PTEB_ACTIVE_FRAME
NTAPI
RtlGetFrame(
VOID
);
//
// Debug Info Functions
//

View file

@ -455,6 +455,32 @@ CmpFindSubKeyByName(
IN PCUNICODE_STRING SearchName
);
HCELL_INDEX
NTAPI
CmpFindSubKeyByNumber(
IN PHHIVE Hive,
IN PCM_KEY_NODE Node,
IN ULONG Number
);
PCELL_DATA
NTAPI
CmpValueToData(
IN PHHIVE Hive,
IN PCM_KEY_VALUE Value,
OUT PULONG Length
);
BOOLEAN
NTAPI
CmpFindNameInList(
IN PHHIVE Hive,
IN PCHILD_LIST ChildList,
IN PUNICODE_STRING Name,
IN PULONG ChildIndex,
IN PHCELL_INDEX CellIndex
);
/* To be implemented by the user of this library */
PVOID
NTAPI

View file

@ -3173,7 +3173,7 @@ static NTSTATUS build_dllredirect_section(ACTIVATION_CONTEXT* actctx, struct str
DPRINT("%d: dll name %S\n", j, dll->name);
/* setup new index entry */
str.Buffer = dll->name;
str.Length = strlenW(dll->name)*sizeof(WCHAR);
str.Length = (USHORT)strlenW(dll->name)*sizeof(WCHAR);
str.MaximumLength = str.Length + sizeof(WCHAR);
/* hash original class name */
RtlHashUnicodeString(&str, TRUE, HASH_STRING_ALGORITHM_X65599, &index->hash);
@ -3390,7 +3390,7 @@ static NTSTATUS build_wndclass_section(ACTIVATION_CONTEXT* actctx, struct strsec
/* setup new index entry */
str.Buffer = entity->u.class.name;
str.Length = strlenW(entity->u.class.name)*sizeof(WCHAR);
str.Length = (USHORT)strlenW(entity->u.class.name)*sizeof(WCHAR);
str.MaximumLength = str.Length + sizeof(WCHAR);
/* hash original class name */
RtlHashUnicodeString(&str, TRUE, HASH_STRING_ALGORITHM_X65599, &index->hash);

View file

@ -389,3 +389,34 @@ DbgCommandString(IN PCCH Name,
/* Send them to the debugger */
DebugService2(&NameString, &CommandString, BREAKPOINT_COMMAND_STRING);
}
/*
* @implemented
*/
VOID
NTAPI
RtlPopFrame(IN PTEB_ACTIVE_FRAME Frame)
{
/* Restore the previous frame as the active one */
NtCurrentTeb()->ActiveFrame = Frame->Previous;
}
/*
* @implemented
*/
VOID
NTAPI
RtlPushFrame(IN PTEB_ACTIVE_FRAME Frame)
{
/* Save the current frame and set the new one as active */
Frame->Previous = NtCurrentTeb()->ActiveFrame;
NtCurrentTeb()->ActiveFrame = Frame;
}
PTEB_ACTIVE_FRAME
NTAPI
RtlGetFrame(VOID)
{
/* Return the frame that's currently active */
return NtCurrentTeb()->ActiveFrame;
}