Author: pschweitzer
Date: Sun Sep 1 14:48:09 2013
New Revision: 59940
URL:
http://svn.reactos.org/svn/reactos?rev=59940&view=rev
Log:
[FRAMEDYN]
Partplement framedyn.dll
So far, only CHString class is implemented in it
Regarding CHString class implementation:
It has been implemented matching Windows behavior and bugs
It might not be really nice at some points but this ensures
compatibility with applications relying on it.
As a side note: this might explain why this API was abandonned after w2k3...
Regarding the DLL itself:
Its implementation into ReactOS allows systeminfo.exe application from w2k3 to
load and start initialization into ReactOS. It stops working later on with some
IDispatch error.
The DLL cannot be used to build any application against framedyn.dll with our
"default" BE (read with G++).
Only MSVC mangled name are exported so far (as on Windows ;-)) thanks to aliasing. This is
why there are two spec files.
This makes G++ unable to link with it though. This is the reason why there are no
framedyn_apitests so far.
Furthermore, the DLL only have exports for x86 and none for x64 for the moment.
Any help is welcome for having exports for x64 target and to be able to have aliasing for
G++ (from its mangled names
to MSVC ones).
Added:
trunk/reactos/dll/win32/framedyn/
trunk/reactos/dll/win32/framedyn/CMakeLists.txt (with props)
trunk/reactos/dll/win32/framedyn/chstring.cpp (with props)
trunk/reactos/dll/win32/framedyn/framedyn_gcc.spec (with props)
trunk/reactos/dll/win32/framedyn/framedyn_msvc.spec (with props)
trunk/reactos/dll/win32/framedyn/main.c (with props)
Modified:
trunk/reactos/dll/win32/CMakeLists.txt
Modified: trunk/reactos/dll/win32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/CMakeLists.txt?r…
==============================================================================
--- trunk/reactos/dll/win32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/CMakeLists.txt [iso-8859-1] Sun Sep 1 14:48:09 2013
@@ -39,6 +39,7 @@
add_subdirectory(dwmapi)
add_subdirectory(faultrep)
add_subdirectory(fmifs)
+add_subdirectory(framedyn)
add_subdirectory(fusion)
add_subdirectory(gdiplus)
add_subdirectory(getuname)
Added: trunk/reactos/dll/win32/framedyn/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/framedyn/CMakeLi…
==============================================================================
--- trunk/reactos/dll/win32/framedyn/CMakeLists.txt (added)
+++ trunk/reactos/dll/win32/framedyn/CMakeLists.txt [iso-8859-1] Sun Sep 1 14:48:09 2013
@@ -0,0 +1,31 @@
+set_cpp(WITH_RUNTIME)
+
+if(NOT MSVC)
+spec2def(framedyn.dll framedyn_gcc.spec ADD_IMPORTLIB)
+else()
+spec2def(framedyn.dll framedyn_msvc.spec ADD_IMPORTLIB)
+endif()
+
+list(APPEND SOURCE
+ main.c
+ chstring.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/framedyn.def)
+
+add_library(framedyn SHARED
+ ${SOURCE})
+
+set_module_type(framedyn win32dll UNICODE)
+
+add_importlibs(framedyn
+ msvcrt
+ kernel32
+ oleaut32
+ ntdll)
+
+if(NOT MSVC)
+ # FIXME:
http://www.cmake.org/Bug/view.php?id=12998
+ #add_target_compile_flags(framedyn "-fexceptions
-Wno-deprecated-declarations")
+ set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-fexceptions
-Wno-deprecated-declarations")
+endif()
+
+add_cd_file(TARGET framedyn DESTINATION reactos/system32/wbem FOR all)
Propchange: trunk/reactos/dll/win32/framedyn/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/framedyn/chstring.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/framedyn/chstrin…
==============================================================================
--- trunk/reactos/dll/win32/framedyn/chstring.cpp (added)
+++ trunk/reactos/dll/win32/framedyn/chstring.cpp [iso-8859-1] Sun Sep 1 14:48:09 2013
@@ -0,0 +1,1406 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS system libraries
+ * FILE: dll/win32/framedyn/chstring.cpp
+ * PURPOSE: CHString class implementation
+ * PROGRAMMERS: Pierre Schweitzer (pierre(a)reactos.org)
+ *
+ * NOTE: This implementation is BROKEN on PURPOSE
+ * The CHString is a mix between std::string and
+ * UNICODE_STRING. It appears that basically it takes only
+ * the worse from both approaches.
+ * I've copied the behavior and implementation of Windows 2k3 even
if
+ * it implies unsafe, wrong or unefficient methods.
+ * Note that the string at m_pchData might not be null terminated!
+ * Also, important note, two (or even more) CHString instances might
+ * have the same m_pchData object! Never forget that while modifying
+ * a string. You might be modifying the string for everyone.
+ * This is why a protected method is being used in the code:
CopyBeforeWrite
+ * It copies source first, to ensure we only modify current string
+ * Side note, all the sizes are actually a number of chars. Only the
size
+ * for implementation is the number of bytes
+ * Now, you know why this class is deprecated and shouldn't be used
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include <chstring.h>
+#define NDEBUG
+#include <debug.h>
+
+/* PRIVATE FUNCTIONS *********************************************************/
+
+// This is the empty string that defaults strings without text
+// This is unsafe. This string show be LPCWSTR
+// However we have to assign it to LPWSTR var. So, let's ignore about const,
+// as MS does. Normally we check in our code that we don't overwrite this string.
+LPWSTR afxPchNil = (LPWSTR)L"\0";
+// This is the data that are matching the null string upper
+CHStringData afxNullData = {0, 0, 0};
+// Exception we may throw in case of allocation failure
+CHeap_Exception HeapException(CHeap_Exception::E_ALLOCATION_ERROR);
+
+// Our own delete operator
+// It is here basically because MS guys don't known about set_new_handler()
+// See operator new
+void operator delete(void* ptr)
+{
+ // In Windows 2k3, they check for ptr being null.
+ // ISO, POSIX and even MSDN explains that it is allowed
+ // to call free with NULL pointer...
+ if (ptr)
+ {
+ free(ptr);
+ }
+}
+
+// Implement our own new operator so that we can throw our own exception in case
+// of allocation failure.
+// It could have been done using set_new_handler(), but well. MS guys didn't do it
+// that way. So, let's mimic.
+void* operator new(size_t uSize)
+{
+ void* Buffer;
+
+ Buffer = malloc(uSize);
+ if (!Buffer)
+ {
+ throw HeapException;
+ }
+
+ return Buffer;
+}
+
+// This is a char to wchar string conversion helper
+int mbstowcsz(LPWSTR lpDest, LPCSTR lpSrc, int nLen)
+{
+ int Conv;
+
+ // If we have nothing to convert or if output doesn't exist, return
+ if (nLen == 0 || lpDest == 0)
+ {
+ return 0;
+ }
+
+ // Then, simply convert
+ Conv = MultiByteToWideChar(CP_ACP, 0, lpSrc, -1, lpDest, nLen);
+ // In case of conversion success, null terminate the string
+ if (Conv != 0)
+ {
+ lpDest[nLen] = 0;
+ }
+
+ return Conv;
+}
+
+/* PUBLIC FUNCTIONS **********************************************************/
+
+/*
+ * @implemented
+ */
+CHString::CHString()
+{
+ // Set to empty string
+ m_pchData = afxPchNil;
+}
+
+/*
+ * @implemented
+ */
+CHString::CHString(WCHAR ch, int nRepeat) throw (CHeap_Exception)
+{
+ // Allow null initialize, in case something goes wrong
+ m_pchData = afxPchNil;
+
+ // If we have a char to insert
+ if (nRepeat >= 1)
+ {
+ // Allocate a buffer big enough
+ AllocBuffer(nRepeat);
+ // And if possible, repeat char
+ if (m_pchData)
+ {
+ for (int i = 0; i < nRepeat; ++i)
+ {
+ m_pchData[i] = ch;
+ }
+ }
+ }
+}
+
+/*
+ * @implemented
+ */
+CHString::CHString(LPCWSTR lpsz) throw (CHeap_Exception)
+{
+ int Len;
+ // Allow null initialize, in case something goes wrong
+ m_pchData = afxPchNil;
+
+ // If we have an input string
+ if (lpsz != 0)
+ {
+ // Get its length
+ Len = SafeStrlen(lpsz);
+ // Then, allocate a big enough buffer and copy string
+ // Note that here, we don't null terminate the string...
+ if (Len)
+ {
+ AllocBuffer(Len);
+ wcsncpy(m_pchData, lpsz, Len);
+ }
+ }
+}
+
+/*
+ * @implemented
+ */
+CHString::CHString(LPCWSTR lpch, int nLength) throw (CHeap_Exception)
+{
+ // Allow null initialize, in case something goes wrong
+ m_pchData = afxPchNil;
+
+ // In case we have a string with a len
+ if (lpch != 0 && nLength != 0)
+ {
+ // Just copy the string
+ AllocBuffer(nLength);
+ wcsncpy(m_pchData, lpch, nLength);
+ }
+}
+
+/*
+ * @implemented
+ */
+CHString::CHString(LPCSTR lpsz) throw (CHeap_Exception)
+{
+ int Len;
+ // Allow null initialize, in case something goes wrong
+ m_pchData = afxPchNil;
+
+ // If we have input string
+ if (lpsz != 0)
+ {
+ // Get its length
+ Len = strlen(lpsz);
+ if (Len)
+ {
+ // Allocate and convert the string
+ AllocBuffer(Len);
+ mbstowcsz(m_pchData, lpsz, Len + 1);
+ // Releasing buffer here is to allow to
+ // update the buffer size. We notify we're
+ // done with changing the string: recompute its
+ // length, please
+ ReleaseBuffer();
+ }
+ }
+}
+
+/*
+ * @implemented
+ */
+CHString::CHString(const unsigned char* lpsz)
+{
+ // Null init
+ Init();
+ // And call operator= with const char*, easier
+ *this = (LPCSTR)lpsz;
+}
+
+/*
+ * @implemented
+ */
+CHString::CHString(const CHString& stringSrc)
+{
+ // If we have currently no referenced string
+ if (stringSrc.GetData()->nRefs < 0)
+ {
+ // Ensure we have the null string
+ m_pchData = afxPchNil;
+ // And then call, the copy operator with input string
+ *this = stringSrc.m_pchData;
+ }
+ else
+ {
+ // Otherwise, just copy the input string
+ m_pchData = stringSrc.m_pchData;
+ // And increment the number of references
+ InterlockedIncrement(&GetData()->nRefs);
+ // The whole point here is: Am I forget to release the old
+ // data?! MS doesn't release it, but I guess we should...
+ }
+}
+
+/*
+ * @implemented
+ */
+CHString::~CHString()
+{
+ // If we have a string
+ if (GetData() != &afxNullData)
+ {
+ // Check whether it's still in use after we release it
+ if (InterlockedDecrement(&GetData()->nRefs) == 0)
+ {
+ // If so, delete it
+ delete GetData();
+ }
+ }
+}
+
+/*
+ * @implemented
+ */
+void CHString::AllocBeforeWrite(int nLen) throw (CHeap_Exception)
+{
+ // In case we have several strings pointing to our memory zone
+ // Or we need bigger buffer than actual
+ if (GetData()->nRefs > 1 || nLen > GetData()->nAllocLength)
+ {
+ // Just drop current
+ // And allocate a new one which is big enough
+ Release();
+ AllocBuffer(nLen);
+ }
+}
+
+/*
+ * @implemented
+ */
+void CHString::AllocBuffer(int nSize) throw (CHeap_Exception)
+{
+ // Here we have to allocate a buffer for the string
+ // It actually consists in: CHStringData structure
+ // with a buffer big enough at its end to store the
+ // string.
+ CHStringData* Data;
+
+ // Null size is easy allocation
+ if (nSize == 0)
+ {
+ m_pchData = afxPchNil;
+ return;
+ }
+
+ // We cannot allow negative sizes
+ if (nSize < 0)
+ {
+ RaiseException(ERROR_INVALID_PARAMETER, EXCEPTION_NONCONTINUABLE, 0, 0);
+ }
+
+ // Nor too big
+ if (nSize > INT_MAX)
+ {
+ RaiseException(STATUS_INTEGER_OVERFLOW, EXCEPTION_NONCONTINUABLE, 0, 0);
+ }
+
+ // Just allocate big enough buffer, using our own operator new
+ Data = (CHStringData *)operator new(nSize * sizeof(WCHAR) + sizeof(CHStringData));
+ // In case Data is null, throw an exception
+ // Yes, this is stupid! Our operator new is already supposed to through an
exception...
+ // Thanks MS
+ if (!Data)
+ {
+ throw HeapException;
+ }
+
+ Data->nRefs = 1;
+ Data->nDataLength = nSize;
+ Data->nAllocLength = nSize;
+ Data->data()[0] = 0;
+
+ // We only return the string
+ // We can find back data with some mathematics
+ m_pchData = Data->data();
+}
+
+/*
+ * @implemented
+ */
+void CHString::AllocCopy(CHString& dest, int nCopyLen, int nCopyIndex, int nExtraLen)
const throw (CHeap_Exception)
+{
+ // Once again, we cannot deal with negative lens
+ if (nCopyLen < 0)
+ {
+ RaiseException(ERROR_INVALID_PARAMETER, EXCEPTION_NONCONTINUABLE, 0, 0);
+ }
+
+ if (nCopyIndex < 0)
+ {
+ RaiseException(ERROR_INVALID_PARAMETER, EXCEPTION_NONCONTINUABLE, 0, 0);
+ }
+
+ if (nExtraLen < 0)
+ {
+ RaiseException(ERROR_INVALID_PARAMETER, EXCEPTION_NONCONTINUABLE, 0, 0);
+ }
+
+ // In case what we have to copy is null-sized, just set empty string
+ if (nCopyLen + nExtraLen == 0)
+ {
+ dest.m_pchData = afxPchNil;
+ return;
+ }
+
+ // Otherwise, allocate a buffer in new string which is big enough
+ // You can note that we absolutely don't check about any existing
+ // (referenced) buffer in dest. Actually, dest is to be EMPTY string.
+ // The whole point of this function is to initialize a virgin string by
+ // copying data from another. This is needed by Left/Mid/Right
+ dest.AllocBuffer(nCopyLen + nExtraLen);
+ // And copy our stuff in
+ wcsncpy(dest.m_pchData, m_pchData + nCopyIndex, nCopyLen);
+}
+
+/*
+ * @implemented
+ */
+BSTR CHString::AllocSysString() const throw (CHeap_Exception)
+{
+ BSTR SysString;
+
+ // Just allocate the string
+ SysString = SysAllocStringLen(m_pchData, GetData()->nDataLength);
+ if (!SysString)
+ {
+ throw HeapException;
+ }
+
+ return SysString;
+}
+
+/*
+ * @implemented
+ */
+void CHString::AssignCopy(int nSrcLen, LPCWSTR lpszSrcData) throw (CHeap_Exception)
+{
+ // Don't allow negative len
+ if (nSrcLen < 0)
+ {
+ RaiseException(ERROR_INVALID_PARAMETER, EXCEPTION_NONCONTINUABLE, 0, 0);
+ }
+
+ // We will have to modify a string that might be shared, so duplicate it
+ // Ensuring it's big enough to contain our new stuff
+ AllocBeforeWrite(nSrcLen);
+ if (nSrcLen == 0)
+ {
+ Release();
+ return;
+ }
+
+ // Just copy, write down new size, and ensure it's null terminated
+ wcsncpy(m_pchData, lpszSrcData, nSrcLen);
+ GetData()->nDataLength = nSrcLen;
+ m_pchData[nSrcLen] = 0;
+}
+
+/*
+ * @implemented
+ */
+int CHString::Collate(LPCWSTR lpsz) const
+{
+ // Just call the deprecated function here - no matter we are null terminated
+ // Did you read my statement about how safe is this implementation?
+ return wcscoll(m_pchData, lpsz);
+}
+
+/*
+ * @implemented
+ */
+int CHString::Compare(LPCWSTR lpsz) const
+{
+ // Just call the deprecated function here - no matter we are null terminated
+ // Did you read my statement about how safe is this implementation?
+ return wcscmp(m_pchData, lpsz);
+}
+
+/*
+ * @implemented
+ */
+int CHString::CompareNoCase(LPCWSTR lpsz) const
+{
+ // Just call the deprecated function here - no matter we are null terminated
+ // Did you read my statement about how safe is this implementation?
+ return wcsicmp(m_pchData, lpsz);
+}
+
+/*
+ * @implemented
+ */
+void CHString::ConcatInPlace(int nSrcLen, LPCWSTR lpszSrcData)
+{
+ // With null length, there's not that much to concat...
+ if (nSrcLen == 0)
+ {
+ return;
+ }
+
+ // Still no negative length
+ if (nSrcLen < 0)
+ {
+ RaiseException(ERROR_INVALID_PARAMETER, EXCEPTION_NONCONTINUABLE, 0, 0);
+ }
+
+ // Ensure we wouldn't overflow with the concat
+ if (GetData()->nDataLength + nSrcLen > INT_MAX)
+ {
+ RaiseException(STATUS_INTEGER_OVERFLOW, EXCEPTION_NONCONTINUABLE, 0, 0);
+ }
+
+ // In case we have to modify a shared string OR if it can't fit into current
buffer...
+ if (GetData()->nRefs > 1 || GetData()->nDataLength + nSrcLen >
GetData()->nAllocLength)
+ {
+ // Allocate a new buffer! (without forgetting to release old one)
+ CHStringData* OldData = GetData();
+
+ // You remember about "InPlace" in the function's name?
+ // The cake is a lie
+ ConcatCopy(GetData()->nDataLength, m_pchData, nSrcLen, lpszSrcData);
+ Release(OldData);
+ }
+ else
+ {
+ // Ensure we don't overflow
+ if (nSrcLen > INT_MAX)
+ {
+ RaiseException(STATUS_INTEGER_OVERFLOW, EXCEPTION_NONCONTINUABLE, 0, 0);
+ }
+
+ // Then, just copy and null terminate
+ wcsncpy(m_pchData + GetData()->nDataLength, lpszSrcData, nSrcLen);
+ GetData()->nDataLength += nSrcLen;
+ m_pchData[GetData()->nDataLength] = 0;
+ }
+}
+
+/*
+ * @implemented
+ */
+void CHString::ConcatCopy(int nSrc1Len, LPCWSTR lpszSrc1Data, int nSrc2Len, LPCWSTR
lpszSrc2Data) throw (CHeap_Exception)
+{
+ int TotalLen;
+
+ if (nSrc1Len < 0 || nSrc2Len < 0)
+ {
+ RaiseException(ERROR_INVALID_PARAMETER, EXCEPTION_NONCONTINUABLE, 0, 0);
+ }
+
+ // If both len are null, do nothing
+ TotalLen = nSrc1Len + nSrc2Len;
+ if (TotalLen == 0)
+ {
+ return;
+ }
+
+ // Otherwise, allocate a new buffer to hold everything (caller will release previous
buffer)
+ AllocBuffer(TotalLen);
+ // And concat stuff
+ wcsncpy(m_pchData, lpszSrc1Data, nSrc1Len);
+ wcsncpy(m_pchData + nSrc1Len, lpszSrc2Data, nSrc2Len);
+}
+
+/*
+ * @implemented
+ */
+void CHString::CopyBeforeWrite() throw (CHeap_Exception)
+{
+ CHStringData* Data;
+
+ // First, we need to get reference count
+ // And we also need to save Data for later copy
+ Data = GetData();
+
+ if (Data->nRefs <= 1)
+ {
+ // If its not used, don't waste time to realloc, it will do the job
+ return;
+ }
+
+ // Release current data - we are sure it won't be freed upon that point
+ // Thanks to the reference count check previously done
+ Release();
+ // Alloc new buffer and copy old data in it
+ AllocBuffer(Data->nDataLength);
+ wcsncpy(m_pchData, Data->data(), Data->nDataLength);
+}
+
+/*
+ * @implemented
+ */
+void CHString::Empty()
+{
+ // Already empty
+ if (GetData()->nDataLength == 0)
+ {
+ return;
+ }
+
+ // Empty it easily given it's reference count
+ if (GetData()->nRefs < 0)
+ {
+ *this = afxPchNil;
+ }
+ else
+ {
+ // Otherwise, just release it
+ // It will set back this instance to afxPchNil
+ // while decreasing reference count
+ Release();
+ }
+}
+
+/*
+ * @implemented
+ */
+int CHString::Find(WCHAR ch) const
+{
+ WCHAR *Found;
+
+ // Let's use appropriate helper
+ Found = wcschr(m_pchData, ch);
+ // We have to return a position, so compute it
+ if (Found)
+ {
+ return (Found - m_pchData);
+ }
+
+ // Otherwise, return no position
+ return -1;
+}
+
+/*
+ * @implemented
+ */
+int CHString::Find(LPCWSTR lpszSub) const
+{
+ WCHAR *Found;
+
+ // Let's use appropriate helper
+ Found = wcsstr(m_pchData, lpszSub);
+ // We have to return a position, so compute it
+ if (Found)
+ {
+ return (Found - m_pchData);
+ }
+
+ // Otherwise, return no position
+ return -1;
+}
+
+/*
+ * @implemented
+ */
+int CHString::FindOneOf(LPCWSTR lpszCharSet) const
+{
+ WCHAR *Found;
+
+ // Let's use appropriate helper
+ Found = wcspbrk(m_pchData, lpszCharSet);
+ // We have to return a position, so compute it
+ if (Found)
+ {
+ return (Found - m_pchData);
+ }
+
+ // Otherwise, return no position
+ return -1;
+}
+
+/*
+ * @implemented
+ */
+void CHString::Format(UINT nFormatID, ...) throw (CHeap_Exception)
+{
+ // Deprecated and not implemented any longer - well, this is its implementation
+ return;
+}
+
+/*
+ * @implemented
+ */
+void CHString::Format(LPCWSTR lpszFormat, ...) throw (CHeap_Exception)
+{
+ // Forward to FormatV
+ va_list ArgsList;
+
+ va_start(ArgsList, lpszFormat);
+ FormatV(lpszFormat, ArgsList);
+ va_end(ArgsList);
+}
+
+/*
+ * @implemented
+ */
+void CHString::FormatMessageW(UINT nFormatID, ...) throw (CHeap_Exception)
+{
+ // Deprecated and not implemented any longer - well, this is its implementation
+ return;
+}
+
+/*
+ * @unimplemented
+ */
+void CHString::FormatMessageW(LPCWSTR lpszFormat, ...) throw (CHeap_Exception)
+{
+ UNIMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+void CHString::FormatV(LPCWSTR lpszFormat, va_list argList)
+{
+ UNIMPLEMENTED;
+}
+
+/*
+ * @implemented
+ */
+void CHString::FreeExtra() throw (CHeap_Exception)
+{
+ CHStringData* OldData;
+
+ // No extra? Do nothing
+ if (GetData()->nDataLength == GetData()->nAllocLength)
+ {
+ return;
+ }
+
+ // Get old buffer
+ OldData = GetData();
+ // Allocate a new one, at the right size (with no place for \0 :-))
+ AllocBuffer(GetData()->nDataLength);
+ // Copy old and release it
+ wcsncpy(m_pchData, OldData->data(), OldData->nDataLength);
+ Release(OldData);
+}
+
+/*
+ * @implemented
+ */
+int CHString::GetAllocLength() const
+{
+ return GetData()->nAllocLength;
+}
+
+/*
+ * @implemented
+ */
+WCHAR CHString::GetAt(int nIndex) const
+{
+ // It's up to you to check the index!
+ return m_pchData[nIndex];
+}
+
+/*
+ * @implemented
+ */
+LPWSTR CHString::GetBuffer(int nMinBufLength) throw (CHeap_Exception)
+{
+ LPWSTR OldBuffer = m_pchData;
+
+ // We'll have to allocate a new buffer if it's not big enough
+ // or if it's shared by several strings
+ if (GetData()->nRefs > 1 || GetData()->nAllocLength < nMinBufLength)
+ {
+ CHStringData* OldData = GetData();
+ int OldLen = GetData()->nDataLength;
+
+ // Ensure we can hold enough
+ if (OldLen > nMinBufLength)
+ {
+ nMinBufLength = OldLen;
+ }
+
+ // Allocate new buffer
+ AllocBuffer(nMinBufLength);
+ // Copy contents
+ wcsncpy(m_pchData, OldBuffer, OldLen);
+ GetData()->nDataLength = OldLen;
+
+ // Release old
+ Release(OldData);
+ }
+
+ // Weirdly, here Windows always returns the old buffer
+ // Which basically exposes a wrong buffer
+ return OldBuffer;
+}
+
+/*
+ * @implemented
+ */
+LPWSTR CHString::GetBufferSetLength(int nNewLength) throw (CHeap_Exception)
+{
+ // Get a buffer big enough
+ // We don't care about the return, it will be set in the string
+ (void)GetBuffer(nNewLength);
+ // Set length, null-terminate and return
+ GetData()->nDataLength = nNewLength;
+ m_pchData[nNewLength] = 0;
+ return m_pchData;
+}
+
+/*
+ * @implemented
+ */
+CHStringData* CHString::GetData() const
+{
+ // In case of empty string, return empty data
+ if (m_pchData == afxPchNil)
+ {
+ return &afxNullData;
+ }
+
+ // Otherwise, do maths
+ return (CHStringData*)((ULONG_PTR)m_pchData - sizeof(CHStringData));
+}
+
+/*
+ * @implemented
+ */
+int CHString::GetLength() const
+{
+ return GetData()->nDataLength;
+}
+
+/*
+ * @implemented
+ */
+void CHString::Init()
+{
+ m_pchData == afxPchNil;
+}
+
+/*
+ * @implemented
+ */
+BOOL CHString::IsEmpty() const
+{
+ return (GetData()->nDataLength == 0);
+}
+
+/*
+ * @implemented
+ */
+CHString CHString::Left(int nCount) const throw (CHeap_Exception)
+{
+ CHString NewString;
+
+ // Validate input (we can't get more than what we have ;-))
+ if (nCount)
+ {
+ if (nCount > GetData()->nDataLength)
+ {
+ nCount = GetData()->nDataLength;
+ }
+ }
+
+ AllocCopy(NewString, nCount, 0, 0);
+
+ return NewString;
+}
+
+/*
+ * @implemented
+ */
+int CHString::LoadStringW(UINT nID) throw (CHeap_Exception)
+{
+ // Deprecated and not implemented any longer - well, this is its implementation
+ return 0;
+}
+
+/*
+ * @implemented
+ */
+int CHString::LoadStringW(UINT nID, LPWSTR lpszBuf, UINT nMaxBuf) throw
(CHeap_Exception)
+{
+ // Deprecated and not implemented any longer - well, this is its implementation
+ return 0;
+}
+
+/*
+ * @implemented
+ */
+LPWSTR CHString::LockBuffer()
+{
+ LPWSTR LockedBuffer;
+
+ // The purpose here is basically to set the nRefs to max int
+ LockedBuffer = GetBuffer(0);
+ GetData()->nRefs = INT_MAX;
+
+ return LockedBuffer;
+}
+
+/*
+ * @implemented
+ */
+void CHString::MakeLower() throw (CHeap_Exception)
+{
+ // We'll modify string, duplicate it first if needed
+ CopyBeforeWrite();
+
+ // Let's use appropriate helper
+ wcslwr(m_pchData);
+}
+
+/*
+ * @implemented
+ */
+void CHString::MakeReverse() throw (CHeap_Exception)
+{
+ // We'll modify string, duplicate it first if needed
+ CopyBeforeWrite();
+
+ // Let's use appropriate helper
+ wcsrev(m_pchData);
+}
+
+/*
+ * @implemented
+ */
+void CHString::MakeUpper() throw (CHeap_Exception)
+{
+ // We'll modify string, duplicate it first if needed
+ CopyBeforeWrite();
+
+ // Let's use appropriate helper
+ wcsupr(m_pchData);
+}
+
+/*
+ * @implemented
+ */
+CHString CHString::Mid(int nFirst) const throw (CHeap_Exception)
+{
+ // Take string from nFirst up to the end
+ return Mid(nFirst, GetData()->nDataLength - nFirst);
+}
+
+/*
+ * @implemented
+ */
+CHString CHString::Mid(int nFirst, int nCount) const throw (CHeap_Exception)
+{
+ CHString NewString;
+
+ // Validate sizes first
+ if (nFirst < 0)
+ {
+ nFirst = 0;
+ }
+
+ if (nCount < 0)
+ {
+ nCount = 0;
+ }
+
+ // Ensure we don't go beyond the string
+ if (nFirst + nCount > GetData()->nDataLength)
+ {
+ nCount = GetData()->nDataLength - nFirst;
+ }
+
+ // Also ensure we don't read beyond
+ // Yes, this should have been done before previous check
+ // MS does it that way
+ if (nFirst > GetData()->nDataLength)
+ {
+ nCount = 0;
+ }
+
+ AllocCopy(NewString, nCount, nFirst, 0);
+
+ return NewString;
+}
+
+/*
+ * @implemented
+ */
+void CHString::Release()
+{
+ // If null string, nothing to do
+ if (GetData() == &afxNullData)
+ {
+ return;
+ }
+
+ // Otherwise, decrement ref count and release if required
+ if (InterlockedDecrement(&GetData()->nRefs) == 0)
+ {
+ delete GetData();
+ }
+
+ // In all cases, caller doesn't want string anymore
+ // So, switch back to empty string
+ m_pchData = afxPchNil;
+}
+
+/*
+ * @implemented
+ */
+void CHString::Release(CHStringData* pData)
+{
+ // If empty string, ignore
+ if (pData == &afxNullData)
+ {
+ return;
+ }
+
+ // Otherwise, simply and free if needed
+ if (InterlockedDecrement(&pData->nRefs) == 0)
+ {
+ delete pData;
+ }
+}
+
+/*
+ * @implemented
+ */
+void CHString::ReleaseBuffer(int nNewLength) throw (CHeap_Exception)
+{
+ CHStringData* Data;
+
+ // We'll modify buffer, so duplicate
+ CopyBeforeWrite();
+
+ // If no len provided, get one
+ if (nNewLength == -1)
+ {
+ nNewLength = wcslen(m_pchData);
+ }
+
+ // Set appropriate size and null-terminate
+ Data = GetData();
+ Data->nDataLength = nNewLength;
+ Data->data()[nNewLength] = 0;
+}
+
+/*
+ * @implemented
+ */
+int CHString::ReverseFind(WCHAR ch) const
+{
+ WCHAR *Last;
+
+ // Let's use appropriate helper
+ Last = wcsrchr(m_pchData, ch);
+ // We have to return a position, so compute it
+ if (Last)
+ {
+ return (Last - m_pchData);
+ }
+
+ // Otherwise, return no position
+ return -1;
+}
+
+/*
+ * @implemented
+ */
+CHString CHString::Right(int nCount) const throw (CHeap_Exception)
+{
+ CHString NewString;
+
+ // Validate input (we can't get more than what we have ;-))
+ if (nCount >= 0)
+ {
+ if (nCount > GetData()->nDataLength)
+ {
+ nCount = GetData()->nDataLength;
+ }
+ }
+
+ AllocCopy(NewString, nCount, GetData()->nDataLength - nCount, 0);
+
+ return NewString;
+}
+
+/*
+ * @implemented
+ */
+int CHString::SafeStrlen(LPCWSTR lpsz)
+{
+ // Check we have a string and then get its length
+ if (lpsz == 0)
+ {
+ return 0;
+ }
+
+ // Of course, it's not safe at all in case string is not null-terminated.
+ // Things that may happen given strings are not to be null-terminated
+ // in this class...
+ return (int)wcslen(lpsz);
+}
+
+/*
+ * @implemented
+ */
+void CHString::SetAt(int nIndex, WCHAR ch) throw (CHeap_Exception)
+{
+ CopyBeforeWrite();
+
+ m_pchData[nIndex] = ch;
+}
+
+/*
+ * @implemented
+ */
+CHString CHString::SpanExcluding(LPCWSTR lpszCharSet) const throw (CHeap_Exception)
+{
+ int Count;
+
+ // Get position and then, extract
+ Count = wcscspn(m_pchData, lpszCharSet);
+ return Left(Count);
+}
+
+/*
+ * @implemented
+ */
+CHString CHString::SpanIncluding(LPCWSTR lpszCharSet) const throw (CHeap_Exception)
+{
+ int Count;
+
+ // Get position and then, extract
+ Count = wcsspn(m_pchData, lpszCharSet);
+ return Left(Count);
+}
+
+/*
+ * @implemented
+ */
+void CHString::TrimLeft() throw (CHeap_Exception)
+{
+ int NewBegin;
+ int NewLength;
+ WCHAR *CurrentChar;
+
+ // We'll modify, so copy first
+ CopyBeforeWrite();
+
+ // Start at the begin of the string
+ CurrentChar = m_pchData;
+ while (*CurrentChar != 0)
+ {
+ // Browse string till we find something which is not a space
+ if (!iswspace(*CurrentChar))
+ {
+ break;
+ }
+
+ CurrentChar++;
+ }
+
+ // Then, calculate new begin (easy) and new length
+ // And move memory
+ NewBegin = (CurrentChar - m_pchData);
+ NewLength = GetData()->nDataLength - NewBegin;
+ memmove(m_pchData, CurrentChar, NewLength * sizeof(WCHAR));
+ GetData()->nDataLength = NewLength;
+}
+
+/*
+ * @implemented
+ */
+void CHString::TrimRight() throw (CHeap_Exception)
+{
+ WCHAR *CurrentChar;
+ WCHAR *CanBeEaten;
+
+ // We'll modify, so copy first
+ CopyBeforeWrite();
+
+ // Start at the begin of the string -- WHAT?!
+ // Yes, this algorithm is the same that MS is
+ // using for its TrimRight.
+ // It is highly unefficient. It would have been
+ // easier to start at nDataLength and to get back to
+ // the begin. Note that it would have been safer as
+ // well, in case the caller is using non-null-terminated
+ // strings. But, well...
+ CurrentChar = m_pchData;
+ CanBeEaten = 0;
+ while (*CurrentChar != 0)
+ {
+ // If not a space, reset what we can trim
+ if (!iswspace(*CurrentChar))
+ {
+ CanBeEaten = 0;
+ }
+ // If it is one, and the first of the spaces serie
+ // Keep its position
+ else if (CanBeEaten == 0)
+ {
+ CanBeEaten = CurrentChar;
+ }
+
+ CurrentChar++;
+ }
+
+ // If nothing to trim, quit
+ if (CanBeEaten == 0)
+ {
+ return;
+ }
+
+ // Otherwise, shorten the string
+ GetData()->nDataLength = (CanBeEaten - m_pchData);
+}
+
+/*
+ * @implemented
+ */
+void CHString::UnlockBuffer()
+{
+ // Unlock means just put ref back to 1
+ // It was previously set to MAX_INT
+ if (GetData() != &afxNullData)
+ {
+ GetData()->nRefs = 1;
+ }
+}
+
+/*
+ * @implemented
+ */
+const CHString& CHString::operator=(char ch) throw (CHeap_Exception)
+{
+ *this = (WCHAR)ch;
+ return *this;
+}
+
+/*
+ * @implemented
+ */
+const CHString& CHString::operator=(WCHAR ch) throw (CHeap_Exception)
+{
+ AssignCopy(1, &ch);
+ return *this;
+}
+
+/*
+ * @implemented
+ */
+const CHString& CHString::operator=(CHString *p) throw (CHeap_Exception)
+{
+ *this = *p;
+ return *this;
+}
+
+/*
+ * @implemented
+ */
+const CHString& CHString::operator=(LPCSTR lpsz) throw (CHeap_Exception)
+{
+ int Len;
+
+ // If we have string, get its len
+ if (lpsz != 0)
+ {
+ Len = strlen(lpsz);
+ }
+ else
+ {
+ Len = 0;
+ }
+
+ // Do this call, even with null len, just to get empty string
+ AllocBeforeWrite(Len);
+ if (Len == 0)
+ {
+ Release();
+ return *this;
+ }
+
+ // Convert and copy
+ mbstowcsz(m_pchData, lpsz, Len + 1);
+ // Get new size and so on
+ ReleaseBuffer();
+
+ return *this;
+}
+
+/*
+ * @implemented
+ */
+const CHString& CHString::operator=(LPCWSTR lpsz) throw (CHeap_Exception)
+{
+ int Len;
+
+ Len = SafeStrlen(lpsz);
+ AssignCopy(Len, lpsz);
+
+ return *this;
+}
+
+/*
+ * @implemented
+ */
+const CHString& CHString::operator=(const CHString& stringSrc) throw
(CHeap_Exception)
+{
+ // Don't copy string on itself
+ if (&stringSrc == this)
+ {
+ return *this;
+ }
+
+ // In case we don't have a referenced string here,
+ // or if the other is not referenced, just copy here
+ if ((GetData()->nRefs < 0 && GetData() != &afxNullData) ||
+ stringSrc.GetData()->nRefs < 0)
+ {
+ AssignCopy(stringSrc.GetData()->nDataLength, stringSrc.m_pchData);
+ return *this;
+ }
+
+ // Otherwise, release current buffer
+ Release();
+ // And set buffer as stringSrc buffer
+ // And increase its reference count
+ m_pchData = stringSrc.m_pchData;
+ InterlockedIncrement(&GetData()->nRefs);
+
+ return *this;
+}
+
+/*
+ * @implemented
+ */
+const CHString& CHString::operator=(const unsigned char* lpsz) throw
(CHeap_Exception)
+{
+ *this = (LPCSTR)lpsz;
+ return *this;
+}
+
+/*
+ * @implemented
+ */
+const CHString& CHString::operator+=(char ch) throw (CHeap_Exception)
+{
+ *this += (WCHAR)ch;
+ return *this;
+}
+
+/*
+ * @implemented
+ */
+const CHString& CHString::operator+=(WCHAR ch) throw (CHeap_Exception)
+{
+ ConcatInPlace(1, &ch);
+ return *this;
+}
+
+/*
+ * @implemented
+ */
+const CHString& CHString::operator+=(LPCWSTR lpsz) throw (CHeap_Exception)
+{
+ int Len;
+
+ Len = SafeStrlen(lpsz);
+ ConcatInPlace(Len, lpsz);
+
+ return *this;
+}
+
+/*
+ * @implemented
+ */
+const CHString& CHString::operator+=(const CHString& string) throw
(CHeap_Exception)
+{
+ ConcatInPlace(string.GetData()->nDataLength, string.m_pchData);
+
+ return *this;
+}
+
+/*
+ * @implemented
+ */
+WCHAR CHString::operator[](int nIndex) const
+{
+ return m_pchData[nIndex];
+}
+
+/*
+ * @implemented
+ */
+CHString::operator LPWSTR()
+{
+ return m_pchData;
+}
+
+/*
+ * @implemented
+ */
+CHString operator+(WCHAR ch, const CHString& string) throw (CHeap_Exception)
+{
+ CHString NewString;
+
+ // Basically concat in a new string
+ NewString.ConcatCopy(1, &ch, string.GetData()->nDataLength,
string.m_pchData);
+
+ return NewString;
+}
+
+/*
+ * @implemented
+ */
+CHString operator+(const CHString& string, WCHAR ch) throw (CHeap_Exception)
+{
+ CHString NewString;
+
+ // Basically concat in a new string
+ NewString.ConcatCopy(string.GetData()->nDataLength, string.m_pchData, 1,
&ch);
+
+ return NewString;
+}
+
+/*
+ * @implemented
+ */
+CHString operator+(const CHString& string, LPCWSTR lpsz) throw (CHeap_Exception)
+{
+ int Len;
+ CHString NewString;
+
+ // Get string length
+ Len = CHString::SafeStrlen(lpsz);
+ // And concat in new string
+ NewString.ConcatCopy(string.GetData()->nDataLength, string.m_pchData, Len, lpsz);
+
+ return NewString;
+}
+
+/*
+ * @implemented
+ */
+CHString operator+(LPCWSTR lpsz, const CHString& string) throw (CHeap_Exception)
+{
+ int Len;
+ CHString NewString;
+
+ // Get string length
+ Len = CHString::SafeStrlen(lpsz);
+ // And concat in new string
+ NewString.ConcatCopy(Len, lpsz, string.GetData()->nDataLength, string.m_pchData);
+
+ return NewString;
+}
+
+/*
+ * @implemented
+ */
+CHString operator+(const CHString& string1, const CHString& string2) throw
(CHeap_Exception)
+{
+ CHString NewString;
+
+ // Basically concat in a new string
+ NewString.ConcatCopy(string1.GetData()->nDataLength, string1.m_pchData,
+ string2.GetData()->nDataLength, string2.m_pchData);
+
+ return NewString;
+}
Propchange: trunk/reactos/dll/win32/framedyn/chstring.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/framedyn/framedyn_gcc.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/framedyn/framedy…
==============================================================================
--- trunk/reactos/dll/win32/framedyn/framedyn_gcc.spec (added)
+++ trunk/reactos/dll/win32/framedyn/framedyn_gcc.spec [iso-8859-1] Sun Sep 1 14:48:09
2013
@@ -0,0 +1,76 @@
+@ thiscall ?AllocBeforeWrite@CHString@@IAEXH@Z(long) _ZN8CHString16AllocBeforeWriteEi
+@ thiscall ?AllocBuffer@CHString@@IAEXH@Zlong(long) _ZN8CHString11AllocBufferEi
+@ thiscall ?AllocCopy@CHString@@IBEXAAV1@HHH@Z(ptr long long long)
_ZNK8CHString9AllocCopyERS_iii
+@ thiscall ?AllocSysString@CHString@@QBEPAGXZ() _ZNK8CHString14AllocSysStringEv
+@ thiscall ?AssignCopy@CHString@@IAEXHPBG@Z(long wstr) _ZN8CHString10AssignCopyEiPKw
+@ thiscall ??0CHString@@QAE@ABV0@@Z(ptr) _ZN8CHStringC2ERKS_
+@ thiscall ??0CHString@@QAE@PBD@Z(str) _ZN8CHStringC2EPKc
+@ thiscall ??0CHString@@QAE@PBE@Z(str) _ZN8CHStringC2EPKh
+@ thiscall ??0CHString@@QAE@PBG@Z(wstr) _ZN8CHStringC2EPKw
+@ thiscall ??0CHString@@QAE@PBGH@Z(wstr long) _ZN8CHStringC2EPKwi
+@ thiscall ??0CHString@@QAE@GH@Z(long long) _ZN8CHStringC2Ewi
+@ thiscall ??0CHString@@QAE@XZ() _ZN8CHStringC2Ev
+@ thiscall ?Collate@CHString@@QBEHPBG@Z(wstr) _ZNK8CHString7CollateEPKw
+@ thiscall ?Compare@CHString@@QBEHPBG@Z(wstr) _ZNK8CHString7CompareEPKw
+@ thiscall ?CompareNoCase@CHString@@QBEHPBG@Z(wstr) _ZNK8CHString13CompareNoCaseEPKw
+@ thiscall ?ConcatCopy@CHString@@IAEXHPBGH0@Z(long wstr long wstr)
_ZN8CHString10ConcatCopyEiPKwiS1_
+@ thiscall ?ConcatInPlace@CHString@@IAEXHPBG@Z(long wstr)
_ZN8CHString13ConcatInPlaceEiPKw
+@ thiscall ?CopyBeforeWrite@CHString@@IAEXXZ() _ZN8CHString15CopyBeforeWriteEv
+@ thiscall ?Empty@CHString@@QAEXXZ() _ZN8CHString5EmptyEv
+@ thiscall ?Find@CHString@@QBEHPBG@Z(wstr) _ZNK8CHString4FindEPKw
+@ thiscall ?Find@CHString@@QBEHG@Z(long) _ZNK8CHString4FindEw
+@ thiscall ?FindOneOf@CHString@@QBEHPBG@Z(wstr) _ZNK8CHString9FindOneOfEPKw
+@ thiscall ?Format@CHString@@QAAXIZZ(long long long) _ZN8CHString6FormatEjz
+@ thiscall ?Format@CHString@@QAAXPBGZZ(long wstr long) _ZN8CHString6FormatEPKwz
+@ thiscall ?FormatMessageW@CHString@@QAAXIZZ(long long long)
_ZN8CHString14FormatMessageWEjz
+@ thiscall ?FormatMessageW@CHString@@QAAXPBGZZ(long ptr long)
_ZN8CHString14FormatMessageWEPKwz
+@ thiscall ?FormatV@CHString@@QAEXPBGPAD@Z(wstr long) _ZN8CHString7FormatVEPKwPc
+@ thiscall ?FreeExtra@CHString@@QAEXXZ() _ZN8CHString9FreeExtraEv
+@ thiscall ?GetAllocLength@CHString@@QBEHXZ() _ZNK8CHString14GetAllocLengthEv
+@ thiscall ?GetAt@CHString@@QBEGH@Z(long) _ZNK8CHString5GetAtEi
+@ thiscall ?GetBuffer@CHString@@QAEPAGH@Z(long) _ZN8CHString9GetBufferEi
+@ thiscall ?GetBufferSetLength@CHString@@QAEPAGH@Z(long)
_ZN8CHString18GetBufferSetLengthEi
+@ thiscall ?GetData@CHString@@IBEPAUCHStringData@@XZ() _ZNK8CHString7GetDataEv
+@ thiscall ?GetLength@CHString@@QBEHXZ() _ZNK8CHString9GetLengthEv
+@ thiscall ?Init@CHString@@IAEXXZ() _ZN8CHString4InitEv
+@ thiscall ?IsEmpty@CHString@@QBEHXZ() _ZNK8CHString7IsEmptyEv
+@ thiscall ?Left@CHString@@QBE?AV1@H@Z(long) _ZNK8CHString4LeftEi
+@ thiscall ?LoadStringW@CHString@@QAEHI@Z(long) _ZN8CHString11LoadStringWEj
+@ thiscall ?LoadStringW@CHString@@IAEHIPAGI@Z(long wstr long)
_ZN8CHString11LoadStringWEjPwj
+@ thiscall ?LockBuffer@CHString@@QAEPAGXZ() _ZN8CHString10LockBufferEv
+@ thiscall ?MakeLower@CHString@@QAEXXZ() _ZN8CHString9MakeLowerEv
+@ thiscall ?MakeReverse@CHString@@QAEXXZ() _ZN8CHString11MakeReverseEv
+@ thiscall ?MakeUpper@CHString@@QAEXXZ() _ZN8CHString9MakeUpperEv
+@ thiscall ?Mid@CHString@@QBE?AV1@H@Z(long) _ZNK8CHString3MidEi
+@ thiscall ?Mid@CHString@@QBE?AV1@HH@Z(long long) _ZNK8CHString3MidEii
+@ thiscall ?Release@CHString@@KGXPAUCHStringData@@@Z(ptr)
_ZN8CHString7ReleaseEP12CHStringData
+@ thiscall ?Release@CHString@@IAEXXZ() _ZN8CHString7ReleaseEv
+@ thiscall ?ReleaseBuffer@CHString@@QAEXH@Z(long) _ZN8CHString13ReleaseBufferEi
+@ thiscall ?ReverseFind@CHString@@QBEHG@Z(long) _ZNK8CHString11ReverseFindEw
+@ thiscall ?Right@CHString@@QBE?AV1@H@Z(long) _ZNK8CHString5RightEi
+@ stdcall ?SafeStrlen@CHString@@KGHPBG@Z(wstr) _ZN8CHString10SafeStrlenEPKw
+@ thiscall ?SetAt@CHString@@QAEXHG@Z(long long) _ZN8CHString5SetAtEiw
+@ thiscall ?SpanExcluding@CHString@@QBE?AV1@PBG@Z(long wstr)
_ZNK8CHString13SpanExcludingEPKw
+@ thiscall ?SpanIncluding@CHString@@QBE?AV1@PBG@Z(long wstr)
_ZNK8CHString13SpanIncludingEPKw
+@ thiscall ?TrimLeft@CHString@@QAEXXZ() _ZN8CHString8TrimLeftEv
+@ thiscall ?TrimRight@CHString@@QAEXXZ() _ZN8CHString9TrimRightEv
+@ thiscall ?UnlockBuffer@CHString@@QAEXXZ() _ZN8CHString12UnlockBufferEv
+@ thiscall ??BCHString@@QBEPBGXZ(ptr) _ZN8CHStringcvPwEv
+@ thiscall ??YCHString@@QAEABV0@ABV0@@Z(ptr) _ZN8CHStringpLERKS_
+@ thiscall ??YCHString@@QAEABV0@D@Z(long) _ZN8CHStringpLEc
+@ thiscall ??YCHString@@QAEABV0@PBG@Z(wstr) _ZN8CHStringpLEPKw
+@ thiscall ??YCHString@@QAEABV0@G@Z(long) _ZN8CHStringpLEw
+@ thiscall ??4CHString@@QAEABV0@PAV0@@Z(ptr) _ZN8CHStringaSEPS_
+@ thiscall ??4CHString@@QAEABV0@ABV0@@Z(ptr) _ZN8CHStringaSERKS_
+@ thiscall ??4CHString@@QAEABV0@PBD@Z(str) _ZN8CHStringaSEPKc
+@ thiscall ??4CHString@@QAEABV0@D@Z(long) _ZN8CHStringaSEc
+@ thiscall ??4CHString@@QAEABV0@PBE@Z(str) _ZN8CHStringaSEPKh
+@ thiscall ??4CHString@@QAEABV0@PBG@Z(wstr) _ZN8CHStringaSEPKw
+@ thiscall ??4CHString@@QAEABV0@G@Z(long) _ZN8CHStringaSEw
+@ thiscall ??ACHString@@QBEGH@Z(long) _ZNK8CHStringixEi
+@ thiscall ??1CHString@@QAE@XZ() _ZN8CHStringD2Ev
+@ stdcall ??H@YG?AVCHString@@GABV0@@Z(long ptr) _ZplwRK8CHString
+@ stdcall ??H@YG?AVCHString@@ABV0@G@Z(ptr long) _ZplRK8CHStringw
+@ stdcall ??H@YG?AVCHString@@ABV0@PBG@Z(ptr wstr) _ZplRK8CHStringPKw
+@ stdcall ??H@YG?AVCHString@@PBGABV0@@Z(wstr ptr) _ZplPKwRK8CHString
+@ stdcall ??H@YG?AVCHString@@ABV0@0@Z(ptr ptr) _ZplRK8CHStringS1_
Propchange: trunk/reactos/dll/win32/framedyn/framedyn_gcc.spec
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/framedyn/framedyn_msvc.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/framedyn/framedy…
==============================================================================
--- trunk/reactos/dll/win32/framedyn/framedyn_msvc.spec (added)
+++ trunk/reactos/dll/win32/framedyn/framedyn_msvc.spec [iso-8859-1] Sun Sep 1 14:48:09
2013
@@ -0,0 +1,76 @@
+@ thiscall ?AllocBeforeWrite@CHString@@IAEXH@Z(long)
+@ thiscall ?AllocBuffer@CHString@@IAEXH@Zlong(long)
+@ thiscall ?AllocCopy@CHString@@IBEXAAV1@HHH@Z(ptr long long long)
+@ thiscall ?AllocSysString@CHString@@QBEPAGXZ()
+@ thiscall ?AssignCopy@CHString@@IAEXHPBG@Z(long wstr)
+@ thiscall ??0CHString@@QAE@ABV0@@Z(ptr)
+@ thiscall ??0CHString@@QAE@PBD@Z(str)
+@ thiscall ??0CHString@@QAE@PBE@Z(str)
+@ thiscall ??0CHString@@QAE@PBG@Z(wstr)
+@ thiscall ??0CHString@@QAE@PBGH@Z(wstr long)
+@ thiscall ??0CHString@@QAE@GH@Z(long long)
+@ thiscall ??0CHString@@QAE@XZ()
+@ thiscall ?Collate@CHString@@QBEHPBG@Z(wstr)
+@ thiscall ?Compare@CHString@@QBEHPBG@Z(wstr)
+@ thiscall ?CompareNoCase@CHString@@QBEHPBG@Z(wstr)
+@ thiscall ?ConcatCopy@CHString@@IAEXHPBGH0@Z(long wstr long wstr)
+@ thiscall ?ConcatInPlace@CHString@@IAEXHPBG@Z(long wstr)
+@ thiscall ?CopyBeforeWrite@CHString@@IAEXXZ()
+@ thiscall ?Empty@CHString@@QAEXXZ()
+@ thiscall ?Find@CHString@@QBEHPBG@Z(wstr)
+@ thiscall ?Find@CHString@@QBEHG@Z(long)
+@ thiscall ?FindOneOf@CHString@@QBEHPBG@Z(wstr)
+@ thiscall ?Format@CHString@@QAAXIZZ(long long long)
+@ thiscall ?Format@CHString@@QAAXPBGZZ(long wstr long)
+@ thiscall ?FormatMessageW@CHString@@QAAXIZZ(long long long)
+@ thiscall ?FormatMessageW@CHString@@QAAXPBGZZ(long ptr long)
+@ thiscall ?FormatV@CHString@@QAEXPBGPAD@Z(wstr long)
+@ thiscall ?FreeExtra@CHString@@QAEXXZ()
+@ thiscall ?GetAllocLength@CHString@@QBEHXZ()
+@ thiscall ?GetAt@CHString@@QBEGH@Z(long)
+@ thiscall ?GetBuffer@CHString@@QAEPAGH@Z(long)
+@ thiscall ?GetBufferSetLength@CHString@@QAEPAGH@Z(long)
+@ thiscall ?GetData@CHString@@IBEPAUCHStringData@@XZ()
+@ thiscall ?GetLength@CHString@@QBEHXZ()
+@ thiscall ?Init@CHString@@IAEXXZ()
+@ thiscall ?IsEmpty@CHString@@QBEHXZ()
+@ thiscall ?Left@CHString@@QBE?AV1@H@Z(long)
+@ thiscall ?LoadStringW@CHString@@QAEHI@Z(long)
+@ thiscall ?LoadStringW@CHString@@IAEHIPAGI@Z(long wstr long)
+@ thiscall ?LockBuffer@CHString@@QAEPAGXZ()
+@ thiscall ?MakeLower@CHString@@QAEXXZ()
+@ thiscall ?MakeReverse@CHString@@QAEXXZ()
+@ thiscall ?MakeUpper@CHString@@QAEXXZ()
+@ thiscall ?Mid@CHString@@QBE?AV1@H@Z(long)
+@ thiscall ?Mid@CHString@@QBE?AV1@HH@Z(long long)
+@ thiscall ?Release@CHString@@KGXPAUCHStringData@@@Z(ptr)
+@ thiscall ?Release@CHString@@IAEXXZ()
+@ thiscall ?ReleaseBuffer@CHString@@QAEXH@Z(long)
+@ thiscall ?ReverseFind@CHString@@QBEHG@Z(long)
+@ thiscall ?Right@CHString@@QBE?AV1@H@Z(long)
+@ stdcall ?SafeStrlen@CHString@@KGHPBG@Z(wstr)
+@ thiscall ?SetAt@CHString@@QAEXHG@Z(long long)
+@ thiscall ?SpanExcluding@CHString@@QBE?AV1@PBG@Z(long wstr)
+@ thiscall ?SpanIncluding@CHString@@QBE?AV1@PBG@Z(long wstr)
+@ thiscall ?TrimLeft@CHString@@QAEXXZ()
+@ thiscall ?TrimRight@CHString@@QAEXXZ()
+@ thiscall ?UnlockBuffer@CHString@@QAEXXZ()
+@ thiscall ??BCHString@@QBEPBGXZ(ptr)
+@ thiscall ??YCHString@@QAEABV0@ABV0@@Z(ptr)
+@ thiscall ??YCHString@@QAEABV0@D@Z(long)
+@ thiscall ??YCHString@@QAEABV0@PBG@Z(wstr)
+@ thiscall ??YCHString@@QAEABV0@G@Z(long)
+@ thiscall ??4CHString@@QAEABV0@PAV0@@Z(ptr)
+@ thiscall ??4CHString@@QAEABV0@ABV0@@Z(ptr)
+@ thiscall ??4CHString@@QAEABV0@PBD@Z(str)
+@ thiscall ??4CHString@@QAEABV0@D@Z(long)
+@ thiscall ??4CHString@@QAEABV0@PBE@Z(str)
+@ thiscall ??4CHString@@QAEABV0@PBG@Z(wstr)
+@ thiscall ??4CHString@@QAEABV0@G@Z(long)
+@ thiscall ??ACHString@@QBEGH@Z(long)
+@ thiscall ??1CHString@@QAE@XZ()
+@ stdcall ??H@YG?AVCHString@@GABV0@@Z(long ptr)
+@ stdcall ??H@YG?AVCHString@@ABV0@G@Z(ptr long)
+@ stdcall ??H@YG?AVCHString@@ABV0@PBG@Z(ptr wstr)
+@ stdcall ??H@YG?AVCHString@@PBGABV0@@Z(wstr ptr)
+@ stdcall ??H@YG?AVCHString@@ABV0@0@Z(ptr ptr)
Propchange: trunk/reactos/dll/win32/framedyn/framedyn_msvc.spec
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/framedyn/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/framedyn/main.c?…
==============================================================================
--- trunk/reactos/dll/win32/framedyn/main.c (added)
+++ trunk/reactos/dll/win32/framedyn/main.c [iso-8859-1] Sun Sep 1 14:48:09 2013
@@ -0,0 +1,27 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS system libraries
+ * FILE: dll/win32/framedyn/main.c
+ * PURPOSE: framedyn entry point
+ * PROGRAMMERS: Pierre Schweitzer (pierre(a)reactos.org)
+ *
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include <windows.h>
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+
+ switch (fdwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(hinstDLL);
+ break;
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+
+ return TRUE;
+}
Propchange: trunk/reactos/dll/win32/framedyn/main.c
------------------------------------------------------------------------------
svn:eol-style = native