Author: ion
Date: Wed Jul 20 14:46:15 2011
New Revision: 52736
URL:
http://svn.reactos.org/svn/reactos?rev=52736&view=rev
Log:
[PSDK]: Add missing QUOTA_LIMITS_EX.
[NDK]: Fix certain SxS functions.
[RTL]: "Implement" RtlActivateActivationContextEx which lets you specify a TEB.
RtlActivateActivationContext uses the current TEB. NOTE: All these functions are broken
because they copy-paste Win32 wine code into NT Native functions (with different
parameters/structures).
[NDK]: Fix pstypes.h -- it was a #define mess, and worked by luck because we are a <
Vista OS.
[NDK]: Add RtlInitEmptyAnsiString.
Modified:
trunk/reactos/include/ndk/pstypes.h
trunk/reactos/include/ndk/rtlfuncs.h
trunk/reactos/include/ndk/rtltypes.h
trunk/reactos/include/psdk/winnt.h
trunk/reactos/lib/rtl/actctx.c
Modified: trunk/reactos/include/ndk/pstypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/pstypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/pstypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/pstypes.h [iso-8859-1] Wed Jul 20 14:46:15 2011
@@ -117,7 +117,6 @@
#define PSP_LONG_QUANTUMS 16
#ifndef NTOS_MODE_USER
-
//
// Thread Access Types
//
@@ -149,6 +148,7 @@
#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \
SYNCHRONIZE | \
0xFFF)
+#endif
//
// Thread Base Priorities
@@ -162,7 +162,6 @@
// TLS Slots
//
#define TLS_MINIMUM_AVAILABLE 64
-#endif
//
// Job Access Types
@@ -194,7 +193,6 @@
#define JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK 0x1000
#define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE 0x2000
-
//
// Cross Thread Flags
//
@@ -223,9 +221,7 @@
#define STA_LPC_EXIT_THREAD_CALLED_BIT 0x2
#define STA_ADDRESS_SPACE_OWNER_BIT 0x4
#define STA_OWNS_WORKING_SET_BITS 0x1F8
-#endif
-
-#define TLS_EXPANSION_SLOTS 1024
+
//
// Process Flags
//
@@ -261,8 +257,22 @@
// Vista Process Flags
//
#define PSF2_PROTECTED_BIT 0x800
+#endif
+
+//
+// TLS/FLS Defines
+//
+#define TLS_EXPANSION_SLOTS 1024
#ifdef NTOS_MODE_USER
+//
+// Thread Native Base Priorities
+//
+#define LOW_PRIORITY 0
+#define LOW_REALTIME_PRIORITY 16
+#define HIGH_PRIORITY 31
+#define MAXIMUM_PRIORITY 32
+
//
// Current Process/Thread built-in 'special' handles
//
Modified: trunk/reactos/include/ndk/rtlfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Wed Jul 20 14:46:15 2011
@@ -171,6 +171,17 @@
UnicodeString->MaximumLength = BufferSize;
UnicodeString->Buffer = Buffer;
}
+
+FORCEINLINE
+VOID
+RtlInitEmptyAnsiString(OUT PANSI_STRING AnsiString,
+ IN PSTR Buffer,
+ IN USHORT BufferSize)
+{
+ AnsiString->Length = 0;
+ AnsiString->MaximumLength = BufferSize;
+ AnsiString->Buffer = Buffer;
+}
//
// LUID Macros
@@ -3046,12 +3057,21 @@
// Activation Context Functions
//
#ifdef NTOS_MODE_USER
+NTSYSAPI
+NTSTATUS
+NTAPI
+RtlActivateActivationContextEx(
+ IN ULONG Flags,
+ IN PTEB Teb,
+ IN PVOID Context,
+ IN PULONG_PTR Cookie
+);
NTSYSAPI
NTSTATUS
NTAPI
RtlActivateActivationContext(
- IN ULONG Unknown,
+ IN ULONG Flags,
IN HANDLE Handle,
OUT PULONG_PTR Cookie
);
@@ -3062,7 +3082,6 @@
RtlAddRefActivationContext(
PVOID Context
);
-
NTSYSAPI
PRTL_ACTIVATION_CONTEXT_STACK_FRAME
Modified: trunk/reactos/include/ndk/rtltypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtltypes.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/rtltypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/rtltypes.h [iso-8859-1] Wed Jul 20 14:46:15 2011
@@ -257,6 +257,11 @@
#define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
//
+// Activation Contexts
+//
+#define INVALID_ACTIVATION_CONTEXT (PVOID)0xFFFFFFFF
+
+//
// C++ CONST casting
//
#if defined(__cplusplus)
@@ -758,20 +763,28 @@
struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME *Previous;
PACTIVATION_CONTEXT ActivationContext;
ULONG Flags;
-} RTL_ACTIVATION_CONTEXT_STACK_FRAME,
- *PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
+} RTL_ACTIVATION_CONTEXT_STACK_FRAME, *PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
+
+typedef struct _RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC
+{
+ SIZE_T Size;
+ ULONG Format;
+ RTL_ACTIVATION_CONTEXT_STACK_FRAME Frame;
+} RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC,
*PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC;
typedef struct _RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED
{
- ULONG Size;
+ SIZE_T Size;
ULONG Format;
RTL_ACTIVATION_CONTEXT_STACK_FRAME Frame;
PVOID Extra1;
PVOID Extra2;
PVOID Extra3;
PVOID Extra4;
-} RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED,
- *PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED;
+} RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED,
*PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED;
+
+typedef RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED
RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME;
+typedef PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED
PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME;
#if (NTDDI_VERSION >= NTDDI_WS03)
typedef struct _ACTIVATION_CONTEXT_STACK
@@ -781,8 +794,7 @@
ULONG Flags;
ULONG NextCookieSequenceNumber;
ULONG StackId;
-} ACTIVATION_CONTEXT_STACK,
- *PACTIVATION_CONTEXT_STACK;
+} ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;
#else
typedef struct _ACTIVATION_CONTEXT_STACK
{
Modified: trunk/reactos/include/psdk/winnt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=5…
==============================================================================
--- trunk/reactos/include/psdk/winnt.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winnt.h [iso-8859-1] Wed Jul 20 14:46:15 2011
@@ -3302,6 +3302,21 @@
SIZE_T PagefileLimit;
LARGE_INTEGER TimeLimit;
} QUOTA_LIMITS,*PQUOTA_LIMITS;
+
+typedef struct _QUOTA_LIMITS_EX {
+ SIZE_T PagedPoolLimit;
+ SIZE_T NonPagedPoolLimit;
+ SIZE_T MinimumWorkingSetSize;
+ SIZE_T MaximumWorkingSetSize;
+ SIZE_T PagefileLimit;
+ LARGE_INTEGER TimeLimit;
+ SIZE_T Reserved1;
+ SIZE_T Reserved2;
+ SIZE_T Reserved3;
+ SIZE_T Reserved4;
+ ULONG Flags;
+ ULONG Reserved5;
+} QUOTA_LIMITS_EX, *PQUOTA_LIMITS_EX;
typedef struct _IO_COUNTERS {
ULONGLONG ReadOperationCount;
Modified: trunk/reactos/lib/rtl/actctx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/actctx.c?rev=52736…
==============================================================================
--- trunk/reactos/lib/rtl/actctx.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/actctx.c [iso-8859-1] Wed Jul 20 14:46:15 2011
@@ -2370,25 +2370,31 @@
}
NTSTATUS
-NTAPI RtlActivateActivationContext( ULONG unknown, HANDLE handle, PULONG_PTR cookie )
+NTAPI RtlActivateActivationContextEx( ULONG flags, PTEB tebAddress, HANDLE handle,
PULONG_PTR cookie )
{
RTL_ACTIVATION_CONTEXT_STACK_FRAME *frame;
-
+
if (!(frame = RtlAllocateHeap( RtlGetProcessHeap(), 0, sizeof(*frame) )))
return STATUS_NO_MEMORY;
-
- frame->Previous =
NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame;
+
+ frame->Previous = tebAddress->ActivationContextStackPointer->ActiveFrame;
frame->ActivationContext = handle;
frame->Flags = 0;
-
- NtCurrentTeb()->ActivationContextStackPointer->ActiveFrame = frame;
+
+ tebAddress->ActivationContextStackPointer->ActiveFrame = frame;
RtlAddRefActivationContext( handle );
-
+
*cookie = (ULONG_PTR)frame;
DPRINT( "%p cookie=%lx\n", handle, *cookie );
return STATUS_SUCCESS;
}
+
+NTSTATUS
+NTAPI RtlActivateActivationContext( ULONG flags, HANDLE handle, PULONG_PTR cookie )
+{
+ return RtlActivateActivationContextEx(flags, NtCurrentTeb(), handle, cookie);
+}
NTSTATUS
NTAPI