Index: /trunk/include/iprt/string.h
===================================================================
--- /trunk/include/iprt/string.h	(revision 35463)
+++ /trunk/include/iprt/string.h	(revision 35464)
@@ -2861,4 +2861,17 @@
 
 /**
+ * Gets a string from a unique string space.
+ *
+ * @returns Pointer to the string node.
+ * @returns NULL if the string was not found in the string space.
+ * @param   pStrSpace       The space to insert it into.
+ * @param   pszString       The string to get.
+ * @param   cchMax          The max string length to evaluate.  Passing
+ *                          RTSTR_MAX is ok and makes it behave just like
+ *                          RTStrSpaceGet.
+ */
+RTDECL(PRTSTRSPACECORE) RTStrSpaceGetN(PRTSTRSPACE pStrSpace, const char *pszString, size_t cchMax);
+
+/**
  * Callback function for RTStrSpaceEnumerate() and RTStrSpaceDestroy().
  *
Index: /trunk/src/VBox/Runtime/common/string/strspace.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/string/strspace.cpp	(revision 35463)
+++ /trunk/src/VBox/Runtime/common/string/strspace.cpp	(revision 35464)
@@ -91,4 +91,17 @@
 
     while ((c = *pu8++))
+        hash = c + (hash << 6) + (hash << 16) - hash;
+
+    *pcch = (uintptr_t)pu8 - (uintptr_t)str - 1;
+    return hash;
+}
+
+DECLINLINE(uint32_t) sdbmN(const char *str, size_t cchMax, size_t *pcch)
+{
+    uint8_t *pu8 = (uint8_t *)str;
+    uint32_t hash = 0;
+    int c;
+
+    while ((c = *pu8++) && cchMax-- > 0)
         hash = c + (hash << 6) + (hash << 16) - hash;
 
@@ -200,4 +213,32 @@
 
 
+/**
+ * Gets a string from a unique string space.
+ *
+ * @returns Pointer to the string node.
+ * @returns NULL if the string was not found in the string space.
+ * @param   pStrSpace       The space to insert it into.
+ * @param   pszString       The string to get.
+ * @param   cchMax          The max string length to evaluate.  Passing
+ *                          RTSTR_MAX is ok and makes it behave just like
+ *                          RTStrSpaceGet.
+ */
+RTDECL(PRTSTRSPACECORE) RTStrSpaceGetN(PRTSTRSPACE pStrSpace, const char *pszString, size_t cchMax)
+{
+    size_t  cchString;
+    KAVLKEY Key = sdbmN(pszString, cchMax, &cchString);
+    PRTSTRSPACECORE pCur = KAVL_FN(Get)(pStrSpace, Key);
+    if (!pCur)
+        return NULL;
+
+    /* Linear search. */
+    for (; pCur; pCur = pCur->pList)
+        if (    pCur->cchString == cchString
+            && !memcmp(pCur->pszString, pszString, cchString))
+            return pCur;
+    return NULL;
+}
+RT_EXPORT_SYMBOL(RTStrSpaceGetN);
+
 
 /**
