- Use ROS-style paths for include files.
- Fixup its CMakeFiles for C++11 compilation under GCC (done the way we did for other C++ projects).
- Add a VS project for DEVMGR to make Ged happy.
[ATL]
Start C++ fixups:
- Add 'placement new' operator.
- Add some missing functions (that were not caught by MSVC compilation because we atm. accept function usage without the existence of its actual code...).
More to follow...
svn path=/trunk/; revision=69348
+PROJECT(DEVMGR)
spec2def(devmgr.dll devmgr.spec ADD_IMPORTLIB)
set_cpp(WITH_RTTI WITH_RUNTIME)
+if(NOT MSVC)
+ # HACK: this should be enabled globally!
+ add_compile_flags_language("-std=c++11" "CXX")
+endif()
+
include_directories(
${REACTOS_SOURCE_DIR}/include/reactos/dll
${REACTOS_SOURCE_DIR}/lib/atl
includes)
list(APPEND SOURCE
- stdafx.h
+ precomp.h
api.cpp
properties/advprop.cpp
properties/devprblm.cpp
set_module_type(devmgr win32dll UNICODE)
target_link_libraries(devmgr uuid atlnew wine)
add_importlibs(devmgr setupapi advapi32 newdev user32 gdi32 comctl32 version msvcrt kernel32 ole32 uxtheme ntdll)
-add_pch(devmgr stdafx.h SOURCE)
+add_pch(devmgr precomp.h SOURCE)
add_cd_file(TARGET devmgr DESTINATION reactos/system32 FOR all)
* 04-04-2004 Created
*/
-#include "stdafx.h"
-#include "devmgmt\MainWindow.h"
+#include "precomp.h"
+#include "devmgmt/MainWindow.h"
HINSTANCE hDllInstance = NULL;
*
*/
-#include "stdafx.h"
+#include "precomp.h"
#include "devmgmt.h"
#include "ClassNode.h"
*
*/
-#include "stdafx.h"
+#include "precomp.h"
#include "devmgmt.h"
#include "DeviceNode.h"
-#include "stdafx.h"
+#include "precomp.h"
#include "devmgmt.h"
#include "DeviceView.h"
*/
-#include "stdafx.h"
+#include "precomp.h"
#include "devmgmt.h"
#include "MainWindow.h"
*
*/
-#include "stdafx.h"
+#include "precomp.h"
#include "devmgmt.h"
#include "Node.h"
*
*/
-#include "stdafx.h"
+#include "precomp.h"
#include "devmgmt.h"
#include "RootNode.h"
* 04-04-2004 Created
*/
-#include "stdafx.h"
-#include <devmgr\devmgr.h>
+#include "precomp.h"
+#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"
* 04-04-2004 Created
*/
-#include "stdafx.h"
-#include <devmgr\devmgr.h>
+#include "precomp.h"
+#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"
* 04-04-2004 Created
*/
-#include "stdafx.h"
-#include <devmgr\devmgr.h>
+#include "precomp.h"
+#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"
* 2005/11/24 Created
*/
-#include "stdafx.h"
-#include <devmgr\devmgr.h>
+#include "precomp.h"
+#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"
* 2005/11/24 Created
*/
-#include "stdafx.h"
-#include <devmgr\devmgr.h>
+#include "precomp.h"
+#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"
* 04-04-2004 Created
*/
-#include "stdafx.h"
+#include "precomp.h"
// remove me
BOOL
#define __ATLCOLL_H__
#pragma once
-#include <atlbase.h>
+#include "atlbase.h"
struct __POSITION
//
#ifdef _MSC_VER
#pragma warning(push)
-#pragma warning(disable: 4200)
+#pragma warning(disable:4200)
#endif
struct ATLSTRINGRESOURCEIMAGE
{
#define __ATLMEM_H__
#pragma once
-#include <atlcore.h>
+#include "atlcore.h"
+
+// HACK HACK! This must be placed in another global ATL header!!
+// Placement new operator
+void *operator new (size_t, void *buf)
+{
+ return buf;
+}
namespace ATL
{
-__interface __declspec(uuid("654F7EF5-CFDF-4df9-A450-6C6A13C622C0")) IAtlMemMgr
+interface DECLSPEC_UUID("654F7EF5-CFDF-4df9-A450-6C6A13C622C0") IAtlMemMgr;
+// #undef INTERFACE
+// #define INTERFACE IAtlMemMgr
+DECLARE_INTERFACE(IAtlMemMgr)
{
public:
_Ret_maybenull_ _Post_writable_byte_size_(SizeBytes) void* Allocate(
if (Buffer)
{
BOOL FreeOk;
+ UNREFERENCED_PARAMETER(FreeOk);
FreeOk = ::HeapFree(m_hHeap, 0, Buffer);
ATLASSERT(FreeOk == TRUE);
}
#pragma once
-#include <atlcore.h>
+#include "atlcore.h"
namespace ATL
{
struct CStringData;
-__interface IAtlStringMgr
+interface IAtlStringMgr;
+// #undef INTERFACE
+// #define INTERFACE IAtlStringMgr
+DECLARE_INTERFACE(IAtlStringMgr)
{
public:
m_pszData[nLength] = 0;
}
+ static CStringData* __cdecl CloneData(_Inout_ CStringData* pData)
+ {
+ CStringData* pNewData = NULL;
+
+ IAtlStringMgr* pNewStringMgr = pData->pStringMgr->Clone();
+ if (!pData->IsLocked() && (pNewStringMgr == pData->pStringMgr))
+ {
+ pNewData = pData;
+ pNewData->AddRef();
+ }
+ else
+ {
+ pNewData = pNewStringMgr->Allocate(pData->nDataLength, sizeof(XCHAR));
+ if (pNewData == NULL)
+ {
+ throw; // ThrowMemoryException();
+ }
+ pNewData->nDataLength = pData->nDataLength;
+ CopyChars(PXSTR(pNewData->data()), pData->nDataLength + 1,
+ PCXSTR(pData->data()), pData->nDataLength + 1);
+ }
+
+ return( pNewData );
+ }
+
};
}
#define __ATLSTR_H__
#pragma once
-#include <atlbase.h>
-#include <cstringt.h>
+#include "atlbase.h"
+#include "cstringt.h"
namespace ATL
{
#define __CSTRINGT_H__
#pragma once
-#include <atlsimpstr.h>
#include <stddef.h>
#include <stdio.h>
#include <wchar.h>
-#include <atlmem.h>
+#include "atlmem.h"
+#include "atlsimpstr.h"
namespace ATL
{
static void __cdecl Construct(_In_ CStringT* pString)
{
- new pString (CStringT);
+ // new pString(CStringT);
+ new (pString) CStringT;
}
CStringT(_In_ const CStringT& strSrc) :