Index: /trunk/include/VBox/sup.h
===================================================================
--- /trunk/include/VBox/sup.h	(revision 35190)
+++ /trunk/include/VBox/sup.h	(revision 35191)
@@ -1036,5 +1036,5 @@
  * @param   pszFilename     Image filename. This must have a path.
  * @param   phLdrMod        Where to store the handle to the loaded module.
- * @param   fFlags          See RTLDRFLAGS_.
+ * @param   fFlags          See RTLDRLOAD_FLAGS_XXX.
  * @param   pErrInfo        Where to return extended error information.
  *                          Optional.
@@ -1052,5 +1052,5 @@
  * @param   pszFilename     Image filename.
  * @param   phLdrMod        Where to store the handle to the loaded module.
- * @param   fFlags          See RTLDRFLAGS_*.
+ * @param   fFlags          See RTLDRLOAD_FLAGS_XXX.
  * @param   pErrInfo        Where to return extended error information.
  *                          Optional.
Index: /trunk/include/iprt/ldr.h
===================================================================
--- /trunk/include/iprt/ldr.h	(revision 35190)
+++ /trunk/include/iprt/ldr.h	(revision 35191)
@@ -36,11 +36,4 @@
  */
 
-/** Symbols defined in this library are not made available to resolve
- * references in subsequently loaded libraries (default). */
-#define RTLDRFLAGS_LOCAL        0
-/** Symbols defined in this library will be made available for symbol
- * resolution of subsequently loaded libraries. */
-#define RTLDRFLAGS_GLOBAL       RT_BIT(0)
-
 
 RT_C_DECLS_BEGIN
@@ -97,8 +90,20 @@
  * @param   pszFilename Image filename.
  * @param   phLdrMod    Where to store the handle to the loader module.
- * @param   fFlags      See RTLDFLAGS_.
+ * @param   fFlags      See RTLDRLOAD_FLAGS_XXX.
  * @param   pErrInfo    Where to return extended error information. Optional.
  */
 RTDECL(int) RTLdrLoadEx(const char *pszFilename, PRTLDRMOD phLdrMod, uint32_t fFlags, PRTERRINFO pErrInfo);
+
+/** @defgroup RTLDRLOAD_FLAGS_XXX RTLdrLoadEx flags.
+ * @{ */
+/** Symbols defined in this library are not made available to resolve
+ * references in subsequently loaded libraries (default). */
+#define RTLDRLOAD_FLAGS_LOCAL       UINT32_C(0)
+/** Symbols defined in this library will be made available for symbol
+ * resolution of subsequently loaded libraries. */
+#define RTLDRLOAD_FLAGS_GLOBAL      RT_BIT_32(0)
+/** The mask of valid flag bits. */
+#define RTLDRLOAD_FLAGS_VALID_MASK  UINT32_C(0x00000001)
+/** @} */
 
 /**
Index: /trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp	(revision 35190)
+++ /trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp	(revision 35191)
@@ -841,5 +841,5 @@
             Log2(("VBoxHeadless: loading VBoxFFmpegFB shared library\n"));
             RTErrInfoInitStatic(&ErrInfo);
-            rrc = SUPR3HardenedLdrLoadAppPriv("VBoxFFmpegFB", &hLdrFFmpegFB, 0 /*fFlags*/, &ErrInfo.Core);
+            rrc = SUPR3HardenedLdrLoadAppPriv("VBoxFFmpegFB", &hLdrFFmpegFB, RTLDRLOAD_FLAGS_LOCAL, &ErrInfo.Core);
 
             if (RT_SUCCESS(rrc))
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 35190)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 35191)
@@ -5115,5 +5115,5 @@
         RTERRINFOSTATIC ErrInfo;
         RTErrInfoInitStatic(&ErrInfo);
-        int vrc = SUPR3HardenedLdrLoadAppPriv("VBoxDbg", &mhVBoxDbg, 0 /*fFlags*/, &ErrInfo.Core);
+        int vrc = SUPR3HardenedLdrLoadAppPriv("VBoxDbg", &mhVBoxDbg, RTLDRLOAD_FLAGS_LOCAL, &ErrInfo.Core);
         if (RT_FAILURE(vrc))
         {
Index: /trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/SUPLib.cpp	(revision 35190)
+++ /trunk/src/VBox/HostDrivers/Support/SUPLib.cpp	(revision 35191)
@@ -2213,5 +2213,5 @@
      * Try load it.
      */
-    return RTLdrLoadEx(pszFilename, phLdrMod, 0 /*fFlags*/, pErrInfo);
+    return RTLdrLoadEx(pszFilename, phLdrMod, RTLDRLOAD_FLAGS_LOCAL, pErrInfo);
 }
 
Index: /trunk/src/VBox/Main/ConsoleVRDPServer.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleVRDPServer.cpp	(revision 35190)
+++ /trunk/src/VBox/Main/ConsoleVRDPServer.cpp	(revision 35191)
@@ -2341,5 +2341,5 @@
             rc = SUPR3HardenedLdrLoadPlugIn(pszLibraryName, &mVRDPLibrary, &ErrInfo.Core);
         else
-            rc = SUPR3HardenedLdrLoadAppPriv(pszLibraryName, &mVRDPLibrary, 0 /*fFlags*/, &ErrInfo.Core);
+            rc = SUPR3HardenedLdrLoadAppPriv(pszLibraryName, &mVRDPLibrary, RTLDRLOAD_FLAGS_LOCAL, &ErrInfo.Core);
         if (RT_SUCCESS(rc))
         {
Index: /trunk/src/VBox/Main/ExtPackManagerImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/ExtPackManagerImpl.cpp	(revision 35190)
+++ /trunk/src/VBox/Main/ExtPackManagerImpl.cpp	(revision 35191)
@@ -1177,5 +1177,5 @@
     if (fIsNative)
     {
-        vrc = RTLdrLoadEx(m->strMainModPath.c_str(), &m->hMainMod, 0 /*fFlags*/, &ErrInfo.Core);
+        vrc = SUPR3HardenedLdrLoadPlugIn(m->strMainModPath.c_str(), &m->hMainMod, &ErrInfo.Core);
         if (RT_FAILURE(vrc))
         {
@@ -1771,5 +1771,5 @@
     if (a_enmContext == VBOXEXTPACKCTX_PER_USER_DAEMON)
     {
-        int vrc = SUPR3HardenedLdrLoadAppPriv("VBoxVMM", &m->hVBoxVMM, RTLDRFLAGS_GLOBAL, NULL);
+        int vrc = SUPR3HardenedLdrLoadAppPriv("VBoxVMM", &m->hVBoxVMM, RTLDRLOAD_FLAGS_GLOBAL, NULL);
         if (RT_FAILURE(vrc))
             m->hVBoxVMM = NIL_RTLDRMOD;
Index: /trunk/src/VBox/Main/VRDEServerImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/VRDEServerImpl.cpp	(revision 35190)
+++ /trunk/src/VBox/Main/VRDEServerImpl.cpp	(revision 35191)
@@ -494,5 +494,5 @@
         rc = SUPR3HardenedLdrLoadPlugIn(pszLibraryName, &hmod, &ErrInfo.Core);
     else
-        rc = SUPR3HardenedLdrLoadAppPriv(pszLibraryName, &hmod, 0 /*fFlags*/, &ErrInfo.Core);
+        rc = SUPR3HardenedLdrLoadAppPriv(pszLibraryName, &hmod, RTLDRLOAD_FLAGS_LOCAL, &ErrInfo.Core);
     if (RT_SUCCESS(rc))
     {
Index: /trunk/src/VBox/Main/hgcm/HGCM.cpp
===================================================================
--- /trunk/src/VBox/Main/hgcm/HGCM.cpp	(revision 35190)
+++ /trunk/src/VBox/Main/hgcm/HGCM.cpp	(revision 35191)
@@ -265,5 +265,5 @@
     RTErrInfoInitStatic (&ErrInfo);
 
-    int rc = SUPR3HardenedLdrLoadAppPriv (m_pszSvcLibrary, &m_hLdrMod, 0 /*fFlags*/, &ErrInfo.Core);
+    int rc = SUPR3HardenedLdrLoadAppPriv (m_pszSvcLibrary, &m_hLdrMod, RTLDRLOAD_FLAGS_LOCAL, &ErrInfo.Core);
 
     if (RT_SUCCESS(rc))
Index: /trunk/src/VBox/Runtime/common/ldr/ldrNative.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/ldr/ldrNative.cpp	(revision 35190)
+++ /trunk/src/VBox/Runtime/common/ldr/ldrNative.cpp	(revision 35191)
@@ -96,5 +96,5 @@
 RTDECL(int) RTLdrLoad(const char *pszFilename, PRTLDRMOD phLdrMod)
 {
-    return RTLdrLoadEx(pszFilename, phLdrMod, 0 /*fFlags*/, NULL);
+    return RTLdrLoadEx(pszFilename, phLdrMod, RTLDRLOAD_FLAGS_LOCAL, NULL);
 }
 RT_EXPORT_SYMBOL(RTLdrLoad);
@@ -111,4 +111,5 @@
     AssertPtrReturn(pszFilename, VERR_INVALID_POINTER);
     AssertPtrReturn(phLdrMod, VERR_INVALID_POINTER);
+    AssertReturn(!(fFlags & ~RTLDRLOAD_FLAGS_VALID_MASK), VERR_INVALID_PARAMETER);
 
     /*
Index: /trunk/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp	(revision 35190)
+++ /trunk/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp	(revision 35191)
@@ -70,5 +70,5 @@
      */
     int fFlagsNative = RTLD_NOW;
-    if (fFlags & RTLDRFLAGS_GLOBAL)
+    if (fFlags & RTLDRLOAD_FLAGS_GLOBAL)
         fFlagsNative |= RTLD_GLOBAL;
     else
Index: /trunk/src/recompiler/VBoxREMWrapper.cpp
===================================================================
--- /trunk/src/recompiler/VBoxREMWrapper.cpp	(revision 35190)
+++ /trunk/src/recompiler/VBoxREMWrapper.cpp	(revision 35191)
@@ -1983,5 +1983,5 @@
     if (g_ModVMM != NIL_RTLDRMOD)
     {
-        rc = SUPR3HardenedLdrLoadAppPriv("VBoxVMM", &g_ModVMM, 0 /*fFlags*/, NULL);
+        rc = SUPR3HardenedLdrLoadAppPriv("VBoxVMM", &g_ModVMM, RTLDRLOAD_FLAGS_LOCAL, NULL);
         AssertRCReturn(rc, rc);
         for (size_t i = 0; i < RT_ELEMENTS(g_aVMMImports); i++)
@@ -2097,5 +2097,5 @@
     if (g_ModVMM == NIL_RTLDRMOD)
     {
-        rc = SUPR3HardenedLdrLoadAppPriv("VBoxVMM", &g_ModVMM, 0 /*fFlags*/, NULL);
+        rc = SUPR3HardenedLdrLoadAppPriv("VBoxVMM", &g_ModVMM, RTLDRLOAD_FLAGS_LOCAL, NULL);
         AssertRCReturn(rc, false);
     }
@@ -2133,5 +2133,5 @@
      */
     const char *pszModule = remIs64bitEnabled(pVM) ? "VBoxREM64" : "VBoxREM32";
-    int rc = SUPR3HardenedLdrLoadAppPriv(pszModule, &g_ModREM2, 0 /*fFlags*/, NULL);
+    int rc = SUPR3HardenedLdrLoadAppPriv(pszModule, &g_ModREM2, RTLDRLOAD_FLAGS_LOCAL, NULL);
     if (RT_SUCCESS(rc))
     {
