[PSDK][REACTOS] Fix definitions and usage of DWLP_MSGRESULT, DWLP_DLGPROC, and DWLP_USER
[reactos.git] / sdk / lib / atl / cstringt.h
index b758514..5d278c5 100644 (file)
@@ -143,6 +143,12 @@ public:
         return ::vswprintf(pszDest, pszFormat, args);
     }
 
+    static BSTR __cdecl AllocSysString(
+        _In_z_ LPCWSTR pszSource,
+        _In_ int nLength)
+    {
+        return ::SysAllocStringLen(pszSource, nLength);
+    }
 };
 
 
@@ -269,6 +275,19 @@ public:
         return ::vsprintf(pszDest, pszFormat, args);
     }
 
+    static BSTR __cdecl AllocSysString(
+        _In_z_ LPCSTR pszSource,
+        _In_ int nLength)
+    {
+        int nLen = ChTraitsCRT<wchar_t>::GetBaseTypeLength(pszSource, nLength);
+        BSTR bstr = ::SysAllocStringLen(NULL, nLen);
+        if (bstr)
+        {
+            ChTraitsCRT<wchar_t>::ConvertToBaseType(bstr, nLen, pszSource, nLength);
+        }
+        return bstr;
+    }
+
 };
 
 
@@ -797,8 +816,14 @@ public:
     }
 
 
+    BSTR AllocSysString() const
+    {
+        return StringTraits::AllocSysString(CThisSimpleString::GetString(), CThisSimpleString::GetLength());
+    }
+
+
 };
 
 } //namespace ATL
 
-#endif
\ No newline at end of file
+#endif