Author: hbelusca
Date: Thu Sep 24 18:06:02 2015
New Revision: 69348
URL:
http://svn.reactos.org/svn/reactos?rev=69348&view=rev
Log:
[DEVMGR_NEW]
- 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...
Added:
trunk/reactos/dll/win32/devmgr_new/precomp.h
- copied unchanged from r69347, trunk/reactos/dll/win32/devmgr_new/stdafx.h
Removed:
trunk/reactos/dll/win32/devmgr_new/stdafx.h
Modified:
trunk/reactos/dll/win32/devmgr_new/CMakeLists.txt
trunk/reactos/dll/win32/devmgr_new/api.cpp
trunk/reactos/dll/win32/devmgr_new/devmgmt/ClassNode.cpp
trunk/reactos/dll/win32/devmgr_new/devmgmt/DeviceNode.cpp
trunk/reactos/dll/win32/devmgr_new/devmgmt/DeviceView.cpp
trunk/reactos/dll/win32/devmgr_new/devmgmt/MainWindow.cpp
trunk/reactos/dll/win32/devmgr_new/devmgmt/Node.cpp
trunk/reactos/dll/win32/devmgr_new/devmgmt/RootNode.cpp
trunk/reactos/dll/win32/devmgr_new/properties/advprop.cpp
trunk/reactos/dll/win32/devmgr_new/properties/devprblm.cpp
trunk/reactos/dll/win32/devmgr_new/properties/hwpage.cpp
trunk/reactos/dll/win32/devmgr_new/properties/hwresource.cpp
trunk/reactos/dll/win32/devmgr_new/properties/misc.cpp
trunk/reactos/dll/win32/devmgr_new/properties/stubs.cpp
trunk/reactos/lib/atl/atlcoll.h
trunk/reactos/lib/atl/atlcore.h
trunk/reactos/lib/atl/atlmem.h
trunk/reactos/lib/atl/atlsimpstr.h
trunk/reactos/lib/atl/atlstr.h
trunk/reactos/lib/atl/cstringt.h
Modified: trunk/reactos/dll/win32/devmgr_new/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/CMake…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/CMakeLists.txt [iso-8859-1] Thu Sep 24 18:06:02
2015
@@ -1,7 +1,13 @@
+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
@@ -9,7 +15,7 @@
includes)
list(APPEND SOURCE
- stdafx.h
+ precomp.h
api.cpp
properties/advprop.cpp
properties/devprblm.cpp
@@ -31,5 +37,5 @@
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)
Modified: trunk/reactos/dll/win32/devmgr_new/api.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/api.c…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/api.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/api.cpp [iso-8859-1] Thu Sep 24 18:06:02 2015
@@ -16,8 +16,8 @@
* 04-04-2004 Created
*/
-#include "stdafx.h"
-#include "devmgmt\MainWindow.h"
+#include "precomp.h"
+#include "devmgmt/MainWindow.h"
HINSTANCE hDllInstance = NULL;
Modified: trunk/reactos/dll/win32/devmgr_new/devmgmt/ClassNode.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/devmg…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/devmgmt/ClassNode.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/devmgmt/ClassNode.cpp [iso-8859-1] Thu Sep 24
18:06:02 2015
@@ -7,7 +7,7 @@
*
*/
-#include "stdafx.h"
+#include "precomp.h"
#include "devmgmt.h"
#include "ClassNode.h"
Modified: trunk/reactos/dll/win32/devmgr_new/devmgmt/DeviceNode.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/devmg…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/devmgmt/DeviceNode.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/devmgmt/DeviceNode.cpp [iso-8859-1] Thu Sep 24
18:06:02 2015
@@ -7,7 +7,7 @@
*
*/
-#include "stdafx.h"
+#include "precomp.h"
#include "devmgmt.h"
#include "DeviceNode.h"
Modified: trunk/reactos/dll/win32/devmgr_new/devmgmt/DeviceView.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/devmg…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/devmgmt/DeviceView.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/devmgmt/DeviceView.cpp [iso-8859-1] Thu Sep 24
18:06:02 2015
@@ -8,7 +8,7 @@
-#include "stdafx.h"
+#include "precomp.h"
#include "devmgmt.h"
#include "DeviceView.h"
Modified: trunk/reactos/dll/win32/devmgr_new/devmgmt/MainWindow.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/devmg…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/devmgmt/MainWindow.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/devmgmt/MainWindow.cpp [iso-8859-1] Thu Sep 24
18:06:02 2015
@@ -7,7 +7,7 @@
*/
-#include "stdafx.h"
+#include "precomp.h"
#include "devmgmt.h"
#include "MainWindow.h"
Modified: trunk/reactos/dll/win32/devmgr_new/devmgmt/Node.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/devmg…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/devmgmt/Node.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/devmgmt/Node.cpp [iso-8859-1] Thu Sep 24 18:06:02
2015
@@ -7,7 +7,7 @@
*
*/
-#include "stdafx.h"
+#include "precomp.h"
#include "devmgmt.h"
#include "Node.h"
Modified: trunk/reactos/dll/win32/devmgr_new/devmgmt/RootNode.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/devmg…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/devmgmt/RootNode.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/devmgmt/RootNode.cpp [iso-8859-1] Thu Sep 24
18:06:02 2015
@@ -7,7 +7,7 @@
*
*/
-#include "stdafx.h"
+#include "precomp.h"
#include "devmgmt.h"
#include "RootNode.h"
Modified: trunk/reactos/dll/win32/devmgr_new/properties/advprop.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/prope…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/properties/advprop.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/properties/advprop.cpp [iso-8859-1] Thu Sep 24
18:06:02 2015
@@ -27,8 +27,8 @@
* 04-04-2004 Created
*/
-#include "stdafx.h"
-#include <devmgr\devmgr.h>
+#include "precomp.h"
+#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"
Modified: trunk/reactos/dll/win32/devmgr_new/properties/devprblm.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/prope…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/properties/devprblm.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/properties/devprblm.cpp [iso-8859-1] Thu Sep 24
18:06:02 2015
@@ -25,8 +25,8 @@
* 04-04-2004 Created
*/
-#include "stdafx.h"
-#include <devmgr\devmgr.h>
+#include "precomp.h"
+#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"
Modified: trunk/reactos/dll/win32/devmgr_new/properties/hwpage.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/prope…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/properties/hwpage.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/properties/hwpage.cpp [iso-8859-1] Thu Sep 24
18:06:02 2015
@@ -25,8 +25,8 @@
* 04-04-2004 Created
*/
-#include "stdafx.h"
-#include <devmgr\devmgr.h>
+#include "precomp.h"
+#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"
Modified: trunk/reactos/dll/win32/devmgr_new/properties/hwresource.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/prope…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/properties/hwresource.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/properties/hwresource.cpp [iso-8859-1] Thu Sep 24
18:06:02 2015
@@ -7,8 +7,8 @@
* 2005/11/24 Created
*/
-#include "stdafx.h"
-#include <devmgr\devmgr.h>
+#include "precomp.h"
+#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"
Modified: trunk/reactos/dll/win32/devmgr_new/properties/misc.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/prope…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/properties/misc.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/properties/misc.cpp [iso-8859-1] Thu Sep 24
18:06:02 2015
@@ -25,8 +25,8 @@
* 2005/11/24 Created
*/
-#include "stdafx.h"
-#include <devmgr\devmgr.h>
+#include "precomp.h"
+#include <devmgr/devmgr.h>
#include "properties.h"
#include "resource.h"
Modified: trunk/reactos/dll/win32/devmgr_new/properties/stubs.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/prope…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/properties/stubs.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/properties/stubs.cpp [iso-8859-1] Thu Sep 24
18:06:02 2015
@@ -16,7 +16,7 @@
* 04-04-2004 Created
*/
-#include "stdafx.h"
+#include "precomp.h"
// remove me
BOOL
Removed: trunk/reactos/dll/win32/devmgr_new/stdafx.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr_new/stdaf…
==============================================================================
--- trunk/reactos/dll/win32/devmgr_new/stdafx.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr_new/stdafx.h (removed)
@@ -1,75 +0,0 @@
-#pragma once
-
-#ifndef __REACTOS__
-
-#define WIN32_LEAN_AND_MEAN
-#include <Windows.h>
-#include <windowsx.h>
-#include <setupapi.h>
-#include <cfgmgr32.h>
-#include <commctrl.h>
-#include <Uxtheme.h>
-#include <Cfgmgr32.h>
-#include <devguid.h>
-#include <process.h>
-#include <RegStr.h>
-
-#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be
explicit
-#include <tchar.h>
-#include <atlbase.h>
-#include <atlstr.h>
-#include <atlcoll.h>
-
-#include <strsafe.h>
-
-#define ERR printf
-#define FIXME printf
-#define UNIMPLEMENTED
-#define WINE_DEFAULT_DEBUG_CHANNEL(t)
-
-DWORD WINAPI pSetupGuidFromString(PCWSTR pString, LPGUID lpGUID);
-
-BOOL
-WINAPI
-InstallDevInst(
-IN HWND hWndParent,
-IN LPCWSTR InstanceId,
-IN BOOL bUpdate,
-OUT LPDWORD lpReboot);
-
-#else
-
-#include <string.h>
-#include <wchar.h>
-
-#include <tchar.h>
-#include <windef.h>
-#include <winbase.h>
-#include <winreg.h>
-#include <wingdi.h>
-#include <winnls.h>
-#include <wincon.h>
-#include <shlobj.h>
-#include <shlwapi.h>
-#include <strsafe.h>
-#include <process.h>
-#include <WindowsX.h>
-#include <strsafe.h>
-#include <regstr.h>
-#include <newdevp.h>
-
-#include <setupapi.h>
-#include <commctrl.h>
-#include <cfgmgr32.h>
-#include <Uxtheme.h>
-#include <devguid.h>
-
-#include <atlbase.h>
-#include <atlstr.h>
-#include <atlcoll.h>
-
-#include <wine/debug.h>
-
-//WINE_DEFAULT_DEBUG_CHANNEL(devmgr);
-
-#endif
Modified: trunk/reactos/lib/atl/atlcoll.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlcoll.h?rev=6934…
==============================================================================
--- trunk/reactos/lib/atl/atlcoll.h [iso-8859-1] (original)
+++ trunk/reactos/lib/atl/atlcoll.h [iso-8859-1] Thu Sep 24 18:06:02 2015
@@ -2,7 +2,7 @@
#define __ATLCOLL_H__
#pragma once
-#include <atlbase.h>
+#include "atlbase.h"
struct __POSITION
Modified: trunk/reactos/lib/atl/atlcore.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlcore.h?rev=6934…
==============================================================================
--- trunk/reactos/lib/atl/atlcore.h [iso-8859-1] (original)
+++ trunk/reactos/lib/atl/atlcore.h [iso-8859-1] Thu Sep 24 18:06:02 2015
@@ -221,7 +221,7 @@
//
#ifdef _MSC_VER
#pragma warning(push)
-#pragma warning(disable: 4200)
+#pragma warning(disable:4200)
#endif
struct ATLSTRINGRESOURCEIMAGE
{
Modified: trunk/reactos/lib/atl/atlmem.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlmem.h?rev=69348…
==============================================================================
--- trunk/reactos/lib/atl/atlmem.h [iso-8859-1] (original)
+++ trunk/reactos/lib/atl/atlmem.h [iso-8859-1] Thu Sep 24 18:06:02 2015
@@ -2,12 +2,22 @@
#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(
@@ -65,6 +75,7 @@
if (Buffer)
{
BOOL FreeOk;
+ UNREFERENCED_PARAMETER(FreeOk);
FreeOk = ::HeapFree(m_hHeap, 0, Buffer);
ATLASSERT(FreeOk == TRUE);
}
Modified: trunk/reactos/lib/atl/atlsimpstr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlsimpstr.h?rev=6…
==============================================================================
--- trunk/reactos/lib/atl/atlsimpstr.h [iso-8859-1] (original)
+++ trunk/reactos/lib/atl/atlsimpstr.h [iso-8859-1] Thu Sep 24 18:06:02 2015
@@ -3,14 +3,17 @@
#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:
@@ -389,6 +392,31 @@
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 );
+ }
+
};
}
Modified: trunk/reactos/lib/atl/atlstr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlstr.h?rev=69348…
==============================================================================
--- trunk/reactos/lib/atl/atlstr.h [iso-8859-1] (original)
+++ trunk/reactos/lib/atl/atlstr.h [iso-8859-1] Thu Sep 24 18:06:02 2015
@@ -2,8 +2,8 @@
#define __ATLSTR_H__
#pragma once
-#include <atlbase.h>
-#include <cstringt.h>
+#include "atlbase.h"
+#include "cstringt.h"
namespace ATL
{
Modified: trunk/reactos/lib/atl/cstringt.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/cstringt.h?rev=693…
==============================================================================
--- trunk/reactos/lib/atl/cstringt.h [iso-8859-1] (original)
+++ trunk/reactos/lib/atl/cstringt.h [iso-8859-1] Thu Sep 24 18:06:02 2015
@@ -2,11 +2,11 @@
#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
{
@@ -90,7 +90,8 @@
static void __cdecl Construct(_In_ CStringT* pString)
{
- new pString (CStringT);
+ // new pString(CStringT);
+ new (pString) CStringT;
}
CStringT(_In_ const CStringT& strSrc) :