Index: /trunk/include/iprt/nt/nt.h
===================================================================
--- /trunk/include/iprt/nt/nt.h	(revision 52940)
+++ /trunk/include/iprt/nt/nt.h	(revision 52941)
@@ -1926,6 +1926,6 @@
 NTSYSAPI VOID NTAPI     LdrInitializeThunk(PVOID, PVOID, PVOID);
 NTSYSAPI NTSTATUS NTAPI RtlExpandEnvironmentStrings_U(PVOID, PUNICODE_STRING, PUNICODE_STRING, PULONG);
-NTSYSAPI VOID NTAPI     RtlExitProcess(NTSTATUS rcExitCode);
-NTSYSAPI VOID NTAPI     RtlExitThread(NTSTATUS rcExitCode);
+NTSYSAPI VOID NTAPI     RtlExitUserProcess(NTSTATUS rcExitCode); /**< Vista and later. */
+NTSYSAPI VOID NTAPI     RtlExitUserThread(NTSTATUS rcExitCode);
 NTSYSAPI NTSTATUS NTAPI RtlDosApplyFileIsolationRedirection_Ustr(IN ULONG fFlags,
                                                                  IN PCUNICODE_STRING pOrgName,
@@ -1937,5 +1937,76 @@
                                                                  IN PSIZE_T pcbFilename OPTIONAL,
                                                                  IN PSIZE_T pcbNeeded OPTIONAL);
+
 # ifdef IPRT_NT_USE_WINTERNL
+typedef NTSTATUS NTAPI RTL_HEAP_COMMIT_ROUTINE(PVOID, PVOID *, PSIZE_T);
+typedef RTL_HEAP_COMMIT_ROUTINE *PRTL_HEAP_COMMIT_ROUTINE;
+typedef struct _RTL_HEAP_PARAMETERS
+{
+    ULONG   Length;
+    SIZE_T  SegmentReserve;
+    SIZE_T  SegmentCommit;
+    SIZE_T  DeCommitFreeBlockThreshold;
+    SIZE_T  DeCommitTotalFreeThreshold;
+    SIZE_T  MaximumAllocationSize;
+    SIZE_T  VirtualMemoryThreshold;
+    SIZE_T  InitialCommit;
+    SIZE_T  InitialReserve;
+    PRTL_HEAP_COMMIT_ROUTINE  CommitRoutine;
+    SIZE_T  Reserved[2];
+} RTL_HEAP_PARAMETERS;
+typedef RTL_HEAP_PARAMETERS *PRTL_HEAP_PARAMETERS;
+NTSYSAPI PVOID NTAPI RtlCreateHeap(ULONG fFlags, PVOID pvHeapBase, SIZE_T cbReserve, SIZE_T cbCommit, PVOID pvLock,
+                                   PRTL_HEAP_PARAMETERS pParameters);
+/** @name Heap flags (for RtlCreateHeap).
+ * @{ */
+/*#  define HEAP_NO_SERIALIZE             UINT32_C(0x00000001)
+#  define HEAP_GROWABLE                 UINT32_C(0x00000002)
+#  define HEAP_GENERATE_EXCEPTIONS      UINT32_C(0x00000004)
+#  define HEAP_ZERO_MEMORY              UINT32_C(0x00000008)
+#  define HEAP_REALLOC_IN_PLACE_ONLY    UINT32_C(0x00000010)
+#  define HEAP_TAIL_CHECKING_ENABLED    UINT32_C(0x00000020)
+#  define HEAP_FREE_CHECKING_ENABLED    UINT32_C(0x00000040)
+#  define HEAP_DISABLE_COALESCE_ON_FREE UINT32_C(0x00000080)*/
+#  define HEAP_SETTABLE_USER_VALUE      UINT32_C(0x00000100)
+#  define HEAP_SETTABLE_USER_FLAG1      UINT32_C(0x00000200)
+#  define HEAP_SETTABLE_USER_FLAG2      UINT32_C(0x00000400)
+#  define HEAP_SETTABLE_USER_FLAG3      UINT32_C(0x00000800)
+#  define HEAP_SETTABLE_USER_FLAGS      UINT32_C(0x00000e00)
+#  define HEAP_CLASS_0                  UINT32_C(0x00000000)
+#  define HEAP_CLASS_1                  UINT32_C(0x00001000)
+#  define HEAP_CLASS_2                  UINT32_C(0x00002000)
+#  define HEAP_CLASS_3                  UINT32_C(0x00003000)
+#  define HEAP_CLASS_4                  UINT32_C(0x00004000)
+#  define HEAP_CLASS_5                  UINT32_C(0x00005000)
+#  define HEAP_CLASS_6                  UINT32_C(0x00006000)
+#  define HEAP_CLASS_7                  UINT32_C(0x00007000)
+#  define HEAP_CLASS_8                  UINT32_C(0x00008000)
+#  define HEAP_CLASS_MASK               UINT32_C(0x0000f000)
+# endif
+# define HEAP_CLASS_PROCESS             HEAP_CLASS_0
+# define HEAP_CLASS_PRIVATE             HEAP_CLASS_1
+# define HEAP_CLASS_KERNEL              HEAP_CLASS_2
+# define HEAP_CLASS_GDI                 HEAP_CLASS_3
+# define HEAP_CLASS_USER                HEAP_CLASS_4
+# define HEAP_CLASS_CONSOLE             HEAP_CLASS_5
+# define HEAP_CLASS_USER_DESKTOP        HEAP_CLASS_6
+# define HEAP_CLASS_CSRSS_SHARED        HEAP_CLASS_7
+# define HEAP_CLASS_CSRSS_PORT          HEAP_CLASS_8
+# ifdef IPRT_NT_USE_WINTERNL
+/*#  define HEAP_CREATE_ALIGN_16          UINT32_C(0x00010000)
+#  define HEAP_CREATE_ENABLE_TRACING    UINT32_C(0x00020000)
+#  define HEAP_CREATE_ENABLE_EXECUTE    UINT32_C(0x00040000)*/
+#  define HEAP_CREATE_VALID_MASK        UINT32_C(0x0007f0ff)
+# endif /* IPRT_NT_USE_WINTERNL */
+/** @} */
+# ifdef IPRT_NT_USE_WINTERNL
+/** @name Heap tagging constants
+ * @{ */
+#  define HEAP_GLOBAL_TAG               UINT32_C(0x00000800)
+/*#  define HEAP_MAXIMUM_TAG              UINT32_C(0x00000fff)
+#  define HEAP_PSEUDO_TAG_FLAG          UINT32_C(0x00008000)
+#  define HEAP_TAG_SHIFT                18 */
+#  define HEAP_TAG_MASK                 (HEAP_MAXIMUM_TAG << HEAP_TAG_SHIFT)
+/** @}  */
 NTSYSAPI PVOID NTAPI    RtlAllocateHeap(HANDLE hHeap, ULONG fFlags, SIZE_T cb);
 NTSYSAPI PVOID NTAPI    RtlReAllocateHeap(HANDLE hHeap, ULONG fFlags, PVOID pvOld, SIZE_T cbNew);
Index: /trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h	(revision 52940)
+++ /trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h	(revision 52941)
@@ -313,4 +313,7 @@
 {
     SUPR3HARDENEDMAINSTATE_NOT_YET_CALLED = 0,
+    SUPR3HARDENEDMAINSTATE_WIN_EP_CALLED,
+    SUPR3HARDENEDMAINSTATE_WIN_IMPORTS_RESOLVED,
+    SUPR3HARDENEDMAINSTATE_WIN_VERSION_INITIALIZED,
     SUPR3HARDENEDMAINSTATE_VERIFY_TRUST_READY,
     SUPR3HARDENEDMAINSTATE_INIT_RUNTIME,
@@ -452,4 +455,5 @@
 extern char         g_szSupLibHardenedExePath[RTPATH_MAX];
 # endif
+DECLHIDDEN(void)    supR3HardenedWinCompactHeaps(void);
 #endif
 
Index: /trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp	(revision 52940)
+++ /trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp	(revision 52941)
@@ -227,9 +227,15 @@
 {
     for (;;)
+    {
 #ifdef RT_OS_WINDOWS
-        RtlExitProcess(rcExit);
+        if (g_enmSupR3HardenedMainState >= SUPR3HARDENEDMAINSTATE_WIN_IMPORTS_RESOLVED)
+            ExitProcess(rcExit);
+        if (RtlExitUserProcess != NULL)
+            RtlExitUserProcess(rcExit);
+        NtTerminateProcess(NtCurrentProcess(), rcExit);
 #else
         _Exit(rcExit);
 #endif
+    }
 }
 
Index: /trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp	(revision 52940)
+++ /trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp	(revision 52941)
@@ -3916,5 +3916,5 @@
      */
     supR3HardenedWinFlushLoaderCache();
-    RtlCompactHeap(GetProcessHeap(), 0 /*dwFlags*/);
+    supR3HardenedWinCompactHeaps();
 
     /*
@@ -5051,4 +5051,5 @@
 
     g_cSuplibHardenedWindowsMainCalls++;
+    g_enmSupR3HardenedMainState = SUPR3HARDENEDMAINSTATE_WIN_EP_CALLED;
 
     /*
@@ -5057,4 +5058,5 @@
      */
     supR3HardenedWinInitImports();
+    g_enmSupR3HardenedMainState = SUPR3HARDENEDMAINSTATE_WIN_IMPORTS_RESOLVED;
 
     /*
@@ -5070,4 +5072,5 @@
      */
     supR3HardenedWinInitVersion();
+    g_enmSupR3HardenedMainState = SUPR3HARDENEDMAINSTATE_WIN_VERSION_INITIALIZED;
 
     /*
Index: /trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainA-win.asm
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainA-win.asm	(revision 52940)
+++ /trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainA-win.asm	(revision 52941)
@@ -162,6 +162,7 @@
 %define SUPHARNT_COMMENT(a_Comment)
 %define SUPHARNT_IMPORT_SYSCALL(a_Name, a_cbParamsX86)       SupHardNtImport a_Name, a_cbParamsX86, SUPHNTIMP_SYSCALL, 1
-%define SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86)       SupHardNtImport a_Name, a_cbParamsX86, 0,                 0
-%define SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86) SupHardNtImport a_Name, a_cbParamsX86, 0,                 1
+%define SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86)       SupHardNtImport a_Name, a_cbParamsX86, 0, 0
+%define SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86) SupHardNtImport a_Name, a_cbParamsX86, 0, 1
+%define SUPHARNT_IMPORT_STDCALL_EARLY_OPTIONAL(a_Name, a_cbParamsX86) SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86)
 %include "import-template-ntdll.h"
 %include "import-template-kernel32.h"
Index: /trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainImports-win.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainImports-win.cpp	(revision 52940)
+++ /trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainImports-win.cpp	(revision 52941)
@@ -72,4 +72,7 @@
      * during early process initialization. */
     PFNRT               pfnEarlyDummy;
+    /** Indicates whether this is an optional import and failure to locate it
+     * should set it to NULL instead of freaking out. */
+    bool                fOptional;
 } SUPHNTIMPFUNC;
 /** Pointer to an import table entry.  */
@@ -156,4 +159,5 @@
 #define SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86) \
     extern PFNRT    RT_CONCAT(g_pfn, a_Name);
+#define SUPHARNT_IMPORT_STDCALL_EARLY_OPTIONAL(a_Name, a_cbParamsX86)  SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86)
 #define SUPHARNT_IMPORT_SYSCALL(a_Name, a_cbParamsX86) \
     SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86) \
@@ -175,8 +179,14 @@
 #undef SUPHARNT_IMPORT_SYSCALL
 #undef SUPHARNT_IMPORT_STDCALL_EARLY
+#undef SUPHARNT_IMPORT_STDCALL_EARLY_OPTIONAL
 #undef SUPHARNT_IMPORT_STDCALL
-#define SUPHARNT_IMPORT_SYSCALL(a_Name, a_cbParamsX86)          { #a_Name, &RT_CONCAT(g_pfn, a_Name), NULL },
-#define SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86)    { #a_Name, &RT_CONCAT(g_pfn, a_Name), NULL },
-#define SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86)          { #a_Name, &RT_CONCAT(g_pfn, a_Name), RT_CONCAT(a_Name,_Early) },
+#define SUPHARNT_IMPORT_SYSCALL(a_Name, a_cbParamsX86) \
+    { #a_Name, &RT_CONCAT(g_pfn, a_Name), NULL, false },
+#define SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86) \
+    { #a_Name, &RT_CONCAT(g_pfn, a_Name), NULL, false },
+#define SUPHARNT_IMPORT_STDCALL_EARLY_OPTIONAL(a_Name, a_cbParamsX86) \
+    { #a_Name, &RT_CONCAT(g_pfn, a_Name), NULL, true },
+#define SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86) \
+    { #a_Name, &RT_CONCAT(g_pfn, a_Name), RT_CONCAT(a_Name,_Early), false },
 static const SUPHNTIMPFUNC g_aSupNtImpNtDllFunctions[] =
 {
@@ -197,4 +207,5 @@
 #undef SUPHARNT_IMPORT_STDCALL
 #undef SUPHARNT_IMPORT_STDCALL_EARLY
+#undef SUPHARNT_IMPORT_STDCALL_EARLY_OPTIONAL
 #ifdef RT_ARCH_AMD64
 # define SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86) \
@@ -208,5 +219,6 @@
     { &RT_CONCAT(g_uApiNo, a_Name), &RT_CONCAT(a_Name,_SyscallType1), &RT_CONCAT(a_Name, _SyscallType2), a_cbParamsX86 },
 #endif
-#define SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86) SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86)
+#define SUPHARNT_IMPORT_STDCALL_EARLY(a_Name, a_cbParamsX86)          SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86)
+#define SUPHARNT_IMPORT_STDCALL_EARLY_OPTIONAL(a_Name, a_cbParamsX86) SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86)
 static const SUPHNTIMPSYSCALL g_aSupNtImpNtDllSyscalls[] =
 {
@@ -399,6 +411,8 @@
     }
 
-    SUPHNTIMP_ERROR(15, "supR3HardenedResolveImport", kSupInitOp_Misc, VERR_SYMBOL_NOT_FOUND,
-                    "%ls: Failed to resolve '%s'.", pDll->pwszName, pImport->pszName);
+    if (!pImport->fOptional)
+        SUPHNTIMP_ERROR(15, "supR3HardenedResolveImport", kSupInitOp_Misc, VERR_SYMBOL_NOT_FOUND,
+                        "%ls: Failed to resolve '%s'.", pDll->pwszName, pImport->pszName);
+    *pImport->ppfnImport = NULL;
     return NULL;
 }
Index: /trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedNoCrt-win.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedNoCrt-win.cpp	(revision 52940)
+++ /trunk/src/VBox/HostDrivers/Support/win/SUPR3HardenedNoCrt-win.cpp	(revision 52941)
@@ -97,4 +97,40 @@
  */
 
+/** The heap we're using. */
+static HANDLE g_hSupR3HardenedHeap = NULL;
+
+
+/**
+ * Lazy heap initialization function.
+ *
+ * @returns Heap handle.
+ */
+static HANDLE supR3HardenedHeapInit(void)
+{
+    HANDLE hHeap = RtlCreateHeap(HEAP_GROWABLE | HEAP_CLASS_PRIVATE, NULL /*HeapBase*/,
+                                 0 /*ReserveSize*/, 0 /*CommitSize*/,  NULL /*Lock*/, NULL /*Parameters*/);
+    if (hHeap)
+    {
+        g_hSupR3HardenedHeap = hHeap;
+        return hHeap;
+    }
+
+    supR3HardenedFatal("RtlCreateHeap failed.\n");
+    return NULL;
+}
+
+
+/**
+ * Compacts the heaps before enter wait for parent/child.
+ */
+DECLHIDDEN(void) supR3HardenedWinCompactHeaps(void)
+{
+    if (g_hSupR3HardenedHeap)
+        RtlCompactHeap(g_hSupR3HardenedHeap, 0 /*dwFlags*/);
+    RtlCompactHeap(GetProcessHeap(), 0 /*dwFlags*/);
+}
+
+
+
 RTDECL(void *) RTMemTmpAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
 {
@@ -117,5 +153,8 @@
 RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
 {
-    void *pv = RtlAllocateHeap(GetProcessHeap(), 0 /*fFlags*/, cb);
+    HANDLE hHeap = g_hSupR3HardenedHeap;
+    if (!hHeap)
+        hHeap = supR3HardenedHeapInit();
+    void *pv = RtlAllocateHeap(hHeap, 0 /*fFlags*/, cb);
     if (!pv)
         supR3HardenedFatal("RtlAllocateHeap failed to allocate %zu bytes.\n", cb);
@@ -126,5 +165,8 @@
 RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
 {
-    void *pv = RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, cb);
+    HANDLE hHeap = g_hSupR3HardenedHeap;
+    if (!hHeap)
+        hHeap = supR3HardenedHeapInit();
+    void *pv = RtlAllocateHeap(hHeap, HEAP_ZERO_MEMORY, cb);
     if (!pv)
         supR3HardenedFatal("RtlAllocateHeap failed to allocate %zu bytes.\n", cb);
@@ -160,5 +202,7 @@
         return RTMemAllocZTag(cbNew, pszTag);
 
-    void *pv = RtlReAllocateHeap(GetProcessHeap(), 0 /*dwFlags*/, pvOld, cbNew);
+    HANDLE hHeap = g_hSupR3HardenedHeap;
+    Assert(hHeap != NULL);
+    void *pv = RtlReAllocateHeap(hHeap, 0 /*dwFlags*/, pvOld, cbNew);
     if (!pv)
         supR3HardenedFatal("RtlReAllocateHeap failed to allocate %zu bytes.\n", cbNew);
@@ -170,5 +214,9 @@
 {
     if (pv)
-        RtlFreeHeap(GetProcessHeap(), 0 /* dwFlags*/, pv);
+    {
+        HANDLE hHeap = g_hSupR3HardenedHeap;
+        Assert(hHeap != NULL);
+        RtlFreeHeap(hHeap, 0 /* dwFlags*/, pv);
+    }
 }
 
Index: /trunk/src/VBox/HostDrivers/Support/win/import-template-kernel32.h
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/win/import-template-kernel32.h	(revision 52940)
+++ /trunk/src/VBox/HostDrivers/Support/win/import-template-kernel32.h	(revision 52941)
@@ -1,4 +1,5 @@
 SUPHARNT_IMPORT_STDCALL(CreateFileW, 28)
 SUPHARNT_IMPORT_STDCALL(CreateProcessW, 40)
+SUPHARNT_IMPORT_STDCALL(ExitProcess, 4)
 SUPHARNT_IMPORT_STDCALL(GetFullPathNameA, 16)
 SUPHARNT_IMPORT_STDCALL(GetModuleFileNameW, 12)
Index: /trunk/src/VBox/HostDrivers/Support/win/import-template-ntdll.h
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/win/import-template-ntdll.h	(revision 52940)
+++ /trunk/src/VBox/HostDrivers/Support/win/import-template-ntdll.h	(revision 52941)
@@ -49,13 +49,14 @@
 
 
-SUPHARNT_IMPORT_STDCALL(NtCreateSection, 28)
-SUPHARNT_IMPORT_STDCALL(NtQueryVolumeInformationFile, 20)
-SUPHARNT_IMPORT_STDCALL(LdrInitializeThunk, 12)
+SUPHARNT_IMPORT_STDCALL_EARLY(NtCreateSection, 28)
+SUPHARNT_IMPORT_STDCALL_EARLY(NtQueryVolumeInformationFile, 20)
+SUPHARNT_IMPORT_STDCALL_EARLY(LdrInitializeThunk, 12)
 SUPHARNT_IMPORT_STDCALL(RtlAddAccessAllowedAce, 16)
 SUPHARNT_IMPORT_STDCALL(RtlAddAccessDeniedAce, 16)
-SUPHARNT_IMPORT_STDCALL(RtlAllocateHeap, 12)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlAllocateHeap, 12)
 SUPHARNT_IMPORT_STDCALL(RtlCompactHeap, 8)
 SUPHARNT_IMPORT_STDCALL(RtlCopySid, 12)
 SUPHARNT_IMPORT_STDCALL(RtlCreateAcl, 12)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlCreateHeap, 24)
 SUPHARNT_IMPORT_STDCALL(RtlCreateProcessParameters, 40)
 SUPHARNT_IMPORT_STDCALL(RtlCreateSecurityDescriptor, 8)
@@ -63,22 +64,22 @@
 SUPHARNT_IMPORT_STDCALL(RtlCreateUserThread, 40)
 SUPHARNT_IMPORT_STDCALL(RtlDestroyProcessParameters, 4)
-SUPHARNT_IMPORT_STDCALL(RtlDosApplyFileIsolationRedirection_Ustr, 36)
-SUPHARNT_IMPORT_STDCALL(RtlEqualSid, 8)
-SUPHARNT_IMPORT_STDCALL(RtlExitProcess, 4)
-SUPHARNT_IMPORT_STDCALL(RtlExitThread, 4)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlDosApplyFileIsolationRedirection_Ustr, 36)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlEqualSid, 8)
+SUPHARNT_IMPORT_STDCALL_EARLY_OPTIONAL(RtlExitUserProcess, 4)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlExitUserThread, 4)
 SUPHARNT_IMPORT_STDCALL(RtlExpandEnvironmentStrings_U, 16)
-SUPHARNT_IMPORT_STDCALL(RtlFreeHeap, 12)
-SUPHARNT_IMPORT_STDCALL(RtlFreeUnicodeString, 4)
-SUPHARNT_IMPORT_STDCALL(RtlGetLastNtStatus, 0)
-SUPHARNT_IMPORT_STDCALL(RtlGetLastWin32Error, 0)
-SUPHARNT_IMPORT_STDCALL(RtlGetVersion, 4)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlFreeHeap, 12)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlFreeUnicodeString, 4)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlGetLastNtStatus, 0)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlGetLastWin32Error, 0)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlGetVersion, 4)
 SUPHARNT_IMPORT_STDCALL(RtlInitializeSid, 12)
-SUPHARNT_IMPORT_STDCALL(RtlNtStatusToDosError, 4)
-SUPHARNT_IMPORT_STDCALL(RtlReAllocateHeap, 16)
-SUPHARNT_IMPORT_STDCALL(RtlRestoreLastWin32Error, 4)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlNtStatusToDosError, 4)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlReAllocateHeap, 16)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlRestoreLastWin32Error, 4)
 SUPHARNT_IMPORT_STDCALL(RtlSetDaclSecurityDescriptor, 16)
-SUPHARNT_IMPORT_STDCALL(RtlSetLastWin32Error, 4)
-SUPHARNT_IMPORT_STDCALL(RtlSetLastWin32ErrorAndNtStatusFromNtStatus, 4)
-SUPHARNT_IMPORT_STDCALL(RtlSizeHeap, 12)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlSetLastWin32Error, 4)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlSetLastWin32ErrorAndNtStatusFromNtStatus, 4)
+SUPHARNT_IMPORT_STDCALL_EARLY(RtlSizeHeap, 12)
 SUPHARNT_IMPORT_STDCALL(RtlSubAuthoritySid, 8)
 
Index: /trunk/src/VBox/Runtime/r3/win/ntdll-mini-implib.def
===================================================================
--- /trunk/src/VBox/Runtime/r3/win/ntdll-mini-implib.def	(revision 52940)
+++ /trunk/src/VBox/Runtime/r3/win/ntdll-mini-implib.def	(revision 52941)
@@ -91,4 +91,5 @@
     RtlCopySid                            ;;= _RtlCopySid@12
     RtlCreateAcl                          ;;= _RtlCreateAcl@12
+    RtlCreateHeap                         ;;= _RtlCreateHeap@24
     RtlCreateProcessParameters            ;;= _RtlCreateProcessParameters@40
     RtlCreateSecurityDescriptor           ;;= _RtlCreateSecurityDescriptor@8
@@ -98,6 +99,6 @@
     RtlDosApplyFileIsolationRedirection_Ustr ;;= _RtlDosApplyFileIsolationRedirection_Ustr@36
     RtlEqualSid                           ;;= _RtlEqualSid@8
-    RtlExitProcess                        ;;= _RtlExitProcess@4
-    RtlExitThread                         ;;= _RtlExitThread@4
+    RtlExitUserProcess                    ;;= _RtlExitProcess@4
+    RtlExitUserThread                     ;;= _RtlExitThread@4
     RtlExpandEnvironmentStrings_U         ;;= _RtlExpandEnvironmentStrings_U@16
     RtlFreeHeap                           ;;= _RtlFreeHeap@12
