mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
[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... svn path=/trunk/; revision=69348
This commit is contained in:
parent
f6bba8eac7
commit
85dcbc9ea2
21 changed files with 78 additions and 32 deletions
|
@ -1,15 +1,21 @@
|
|||
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
|
||||
|
@ -31,5 +37,5 @@ add_library(devmgr SHARED
|
|||
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)
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "precomp.h"
|
||||
#include "devmgmt.h"
|
||||
#include "ClassNode.h"
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "precomp.h"
|
||||
#include "devmgmt.h"
|
||||
#include "DeviceNode.h"
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "precomp.h"
|
||||
#include "devmgmt.h"
|
||||
#include "DeviceView.h"
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "precomp.h"
|
||||
#include "devmgmt.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "precomp.h"
|
||||
#include "devmgmt.h"
|
||||
#include "Node.h"
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "precomp.h"
|
||||
#include "devmgmt.h"
|
||||
#include "RootNode.h"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* 04-04-2004 Created
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "precomp.h"
|
||||
|
||||
// remove me
|
||||
BOOL
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define __ATLCOLL_H__
|
||||
|
||||
#pragma once
|
||||
#include <atlbase.h>
|
||||
#include "atlbase.h"
|
||||
|
||||
|
||||
struct __POSITION
|
||||
|
|
|
@ -221,7 +221,7 @@ extern CAtlBaseModule _AtlBaseModule;
|
|||
//
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4200)
|
||||
#pragma warning(disable:4200)
|
||||
#endif
|
||||
struct ATLSTRINGRESOURCEIMAGE
|
||||
{
|
||||
|
|
|
@ -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 @@ public:
|
|||
if (Buffer)
|
||||
{
|
||||
BOOL FreeOk;
|
||||
UNREFERENCED_PARAMETER(FreeOk);
|
||||
FreeOk = ::HeapFree(m_hHeap, 0, Buffer);
|
||||
ATLASSERT(FreeOk == TRUE);
|
||||
}
|
||||
|
|
|
@ -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 @@ private:
|
|||
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 );
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#define __ATLSTR_H__
|
||||
|
||||
#pragma once
|
||||
#include <atlbase.h>
|
||||
#include <cstringt.h>
|
||||
#include "atlbase.h"
|
||||
#include "cstringt.h"
|
||||
|
||||
namespace ATL
|
||||
{
|
||||
|
|
|
@ -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 @@ public:
|
|||
|
||||
static void __cdecl Construct(_In_ CStringT* pString)
|
||||
{
|
||||
new pString (CStringT);
|
||||
// new pString(CStringT);
|
||||
new (pString) CStringT;
|
||||
}
|
||||
|
||||
CStringT(_In_ const CStringT& strSrc) :
|
||||
|
|
Loading…
Reference in a new issue