Skip to content

Commit f83a7d4

Browse files
committed
[Some tests]
- Ros ATL COM Test dll - MSVC ATL COM Test dll - ATL test app - LogCom dll. Outputs loading of borwseui COM objects svn path=/branches/GSoC_2011/NewExplorer/; revision=52683
1 parent 5ddfa57 commit f83a7d4

File tree

197 files changed

+2360
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+2360
-0
lines changed

dll/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ add_subdirectory(nls)
77
add_subdirectory(ntdll)
88
add_subdirectory(shellext)
99
add_subdirectory(win32)
10+
add_subdirectory(test)
11+

dll/test/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
add_subdirectory(comtest)
3+

dll/test/comtest/CMakeLists.txt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
set_unicode()
2+
set_cpp()
3+
4+
add_definitions(
5+
-D__WINESRC__
6+
-DROS_Headers)
7+
8+
remove_definitions(-D_WIN32_WINNT=0x502)
9+
add_definitions(-D_WIN32_WINNT=0x600)
10+
11+
include_directories(
12+
${REACTOS_SOURCE_DIR}/include/reactos/wine
13+
${REACTOS_SOURCE_DIR}/lib/atl)
14+
15+
set_rc_compiler()
16+
17+
spec2def(comtest.dll comtest.spec)
18+
19+
list(APPEND SOURCE
20+
IComTest.h
21+
IComTest_i.c
22+
comtest.cpp
23+
comtest.h
24+
dllmain.cpp
25+
stdafx.cpp
26+
stdafx.h
27+
targetver.h
28+
${CMAKE_CURRENT_BINARY_DIR}/comtest.def)
29+
30+
31+
add_library(comtest SHARED ${SOURCE})
32+
set_module_type(comtest win32dll)
33+
34+
target_link_libraries(comtest
35+
atlnew
36+
uuid
37+
wine)
38+
39+
add_importlibs(comtest
40+
shlwapi
41+
shell32
42+
comctl32
43+
gdi32
44+
ole32
45+
oleaut32
46+
user32
47+
advapi32
48+
msvcrt
49+
kernel32
50+
ntdll)
51+
52+
add_cab_target(comtest 1)

dll/test/comtest/IComTest.h

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*** Autogenerated by WIDL 0.4-SVN from D:/reactos/reactos_atl/dll/test/idl/IComTest.idl - Do not edit ***/
2+
3+
#include <rpc.h>
4+
#include <rpcndr.h>
5+
6+
#ifndef __WIDL_ICOMTEST_H
7+
#define __WIDL_ICOMTEST_H
8+
9+
/* Forward declarations */
10+
11+
#ifndef __IComTest_FWD_DEFINED__
12+
#define __IComTest_FWD_DEFINED__
13+
typedef interface IComTest IComTest;
14+
#endif
15+
16+
/* Headers for imported files */
17+
18+
#include <unknwn.h>
19+
20+
#ifdef __cplusplus
21+
extern "C" {
22+
#endif
23+
24+
/*****************************************************************************
25+
* IComTest interface
26+
*/
27+
#ifndef __IComTest_INTERFACE_DEFINED__
28+
#define __IComTest_INTERFACE_DEFINED__
29+
30+
DEFINE_GUID(IID_IComTest, 0x10cdf249, 0xa336, 0x406f, 0xb4,0x72, 0x20,0xf0,0x86,0x60,0xd6,0x09);
31+
#if defined(__cplusplus) && !defined(CINTERFACE)
32+
interface IComTest : public IUnknown
33+
{
34+
virtual HRESULT STDMETHODCALLTYPE test(
35+
) = 0;
36+
37+
};
38+
#else
39+
typedef struct IComTestVtbl {
40+
BEGIN_INTERFACE
41+
42+
/*** IUnknown methods ***/
43+
HRESULT (STDMETHODCALLTYPE *QueryInterface)(
44+
IComTest* This,
45+
REFIID riid,
46+
void **ppvObject);
47+
48+
ULONG (STDMETHODCALLTYPE *AddRef)(
49+
IComTest* This);
50+
51+
ULONG (STDMETHODCALLTYPE *Release)(
52+
IComTest* This);
53+
54+
/*** IComTest methods ***/
55+
HRESULT (STDMETHODCALLTYPE *test)(
56+
IComTest* This);
57+
58+
END_INTERFACE
59+
} IComTestVtbl;
60+
interface IComTest {
61+
CONST_VTBL IComTestVtbl* lpVtbl;
62+
};
63+
64+
#ifdef COBJMACROS
65+
/*** IUnknown methods ***/
66+
#define IComTest_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
67+
#define IComTest_AddRef(This) (This)->lpVtbl->AddRef(This)
68+
#define IComTest_Release(This) (This)->lpVtbl->Release(This)
69+
/*** IComTest methods ***/
70+
#define IComTest_test(This) (This)->lpVtbl->test(This)
71+
#endif
72+
73+
#endif
74+
75+
HRESULT STDMETHODCALLTYPE IComTest_test_Proxy(
76+
IComTest* This);
77+
void __RPC_STUB IComTest_test_Stub(
78+
IRpcStubBuffer* This,
79+
IRpcChannelBuffer* pRpcChannelBuffer,
80+
PRPC_MESSAGE pRpcMessage,
81+
DWORD* pdwStubPhase);
82+
83+
#endif /* __IComTest_INTERFACE_DEFINED__ */
84+
85+
/* Begin additional prototypes for all interfaces */
86+
87+
88+
/* End additional prototypes */
89+
90+
#ifdef __cplusplus
91+
}
92+
#endif
93+
94+
#endif /* __WIDL_ICOMTEST_H */

dll/test/comtest/IComTest.idl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import "unknwn.idl";
2+
[
3+
object,
4+
uuid(10CDF249-A336-406F-B472-20F08660D609),
5+
]
6+
interface IComTest : IUnknown
7+
{
8+
HRESULT test(void);
9+
};
10+

dll/test/comtest/IComTest_i.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*** Autogenerated by WIDL 0.4-SVN from D:/reactos/reactos_atl/dll/test/idl/IComTest.idl - Do not edit ***/
2+
3+
#include <rpc.h>
4+
#include <rpcndr.h>
5+
6+
#include <initguid.h>
7+
8+
#ifdef __cplusplus
9+
extern "C" {
10+
#endif
11+
12+
DEFINE_GUID(IID_IComTest, 0x10cdf249, 0xa336, 0x406f, 0xb4,0x72, 0x20,0xf0,0x86,0x60,0xd6,0x09);
13+
14+
#ifdef __cplusplus
15+
}
16+
#endif
17+

dll/test/comtest/comtest.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// comtest.cpp : Defines the exported functions for the DLL application.
2+
//
3+
4+
#include "stdafx.h"
5+
#include "comtest.h"
6+
7+
8+
ComTestBase::ComTestBase()
9+
{
10+
OutputDebugStringW(L"ComTestBase");
11+
}
12+
13+
ComTestBase::~ComTestBase()
14+
{
15+
OutputDebugStringW(L"~ComTestBase");
16+
}
17+
18+
STDMETHODIMP ComTestBase::test(void)
19+
{
20+
return S_OK;
21+
}
22+

dll/test/comtest/comtest.def

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
LIBRARY comtest
2+
EXPORTS
3+
DllCanUnloadNow @1
4+
DllGetClassObject @2
5+
DllRegisterServer @3
6+
DllUnregisterServer @4

dll/test/comtest/comtest.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#include <windows.h>
2+
#include <shlobj.h>
3+
#include <shlobj_undoc.h>
4+
#include <shlguid.h>
5+
#include <shlguid_undoc.h>
6+
#include <shlwapi.h>
7+
#include <tchar.h>
8+
#include <atlbase.h>
9+
#include <atlcom.h>
10+
#include <atlwin.h>
11+
#include "iComTest.h"
12+
//#include "iComTest.h"
13+
//#include "iComTest_i.c"
14+
//#include "iComTest_p.c"
15+
16+
#define IDR_COMTEST 101
17+
18+
19+
// {C4CC78DB-8266-4ae7-8685-8EE05376CB09}
20+
DEFINE_GUID(CLSID_ComTest, 0xc4cc78db, 0x8266, 0x4ae7, 0x86, 0x85, 0x8e, 0xe0, 0x53, 0x76, 0xcb, 0x9);
21+
//static const GUID CLSID_ComTest = {0xc4cc78db,0x8266,0x4ae7,{0x86,0x85,0x8e,0xe0,0x53,0x76,0xcb,0x9}};
22+
23+
24+
//const IID IID_IComTest = {0x10CDF249,0xA336,0x406F,{0xB4,0x72,0x20,0xF0,0x86,0x60,0xD6,0x09}};
25+
26+
27+
class ComTestBase :
28+
public CComObjectRootEx<CComMultiThreadModelNoCS>,
29+
public IComTest
30+
{
31+
public:
32+
ComTestBase();
33+
~ComTestBase();
34+
35+
// *** IComTest methods ***
36+
virtual HRESULT STDMETHODCALLTYPE test(void);
37+
38+
39+
BEGIN_COM_MAP(ComTestBase)
40+
COM_INTERFACE_ENTRY_IID(IID_IComTest, IComTest)
41+
END_COM_MAP()
42+
};
43+
44+
class ComTest :
45+
public CComCoClass<ComTest, &CLSID_ComTest>,
46+
public ComTestBase
47+
{
48+
public:
49+
DECLARE_REGISTRY_RESOURCEID(IDR_COMTEST)
50+
DECLARE_NOT_AGGREGATABLE(ComTest)
51+
52+
DECLARE_PROTECT_FINAL_CONSTRUCT()
53+
};

dll/test/comtest/comtest.spec

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@ stdcall -private DllCanUnloadNow()
2+
@ stdcall -private DllGetClassObject(ptr ptr ptr)
3+
@ stdcall -private DllRegisterServer()
4+
@ stdcall -private DllUnregisterServer()

dll/test/comtest/dllmain.cpp

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// dllmain.cpp : Defines the entry point for the DLL application.
2+
3+
4+
5+
#include <windows.h>
6+
#include <shlobj.h>
7+
#include <shlobj_undoc.h>
8+
#include <shlguid.h>
9+
#include <shlguid_undoc.h>
10+
#include <shlwapi.h>
11+
#include <tchar.h>
12+
#include <atlbase.h>
13+
#include <atlcom.h>
14+
#include <atlwin.h>
15+
#include <initguid.h>
16+
#include "stdafx.h"
17+
#include "comtest.h"
18+
19+
20+
extern const IID IID_IComTest;
21+
22+
CComModule gModule;
23+
24+
25+
BEGIN_OBJECT_MAP(ObjectMap)
26+
OBJECT_ENTRY(CLSID_ComTest, ComTest)
27+
END_OBJECT_MAP()
28+
29+
30+
31+
STDAPI_(BOOL) DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID fImpLoad)
32+
{
33+
OutputDebugStringW(L"DllMain");
34+
switch (dwReason)
35+
{
36+
case DLL_PROCESS_ATTACH:
37+
OutputDebugStringW(L"DLL_PROCESS_ATTACH");
38+
gModule.Init(ObjectMap, hInstance, NULL);
39+
DisableThreadLibraryCalls(hInstance);
40+
break;
41+
case DLL_THREAD_ATTACH:
42+
case DLL_THREAD_DETACH:
43+
case DLL_PROCESS_DETACH:
44+
OutputDebugStringW(L"DLL_PROCESS_DETACH");
45+
gModule.Term();
46+
break;
47+
}
48+
return TRUE;
49+
}
50+
51+
52+
53+
STDAPI DllCanUnloadNow()
54+
{
55+
OutputDebugStringW(L"DllCanUnloadNow");
56+
return gModule.DllCanUnloadNow();
57+
}
58+
59+
60+
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
61+
{
62+
OutputDebugStringW(L"DllGetClassObject");
63+
return gModule.DllGetClassObject(rclsid, riid, ppv);
64+
}
65+
66+
STDAPI DllRegisterServer()
67+
{
68+
OutputDebugStringW(L"DllRegisterServer");
69+
return gModule.DllRegisterServer(FALSE);
70+
}
71+
72+
STDAPI DllUnregisterServer()
73+
{
74+
OutputDebugStringW(L"DllUnregisterServer");
75+
return gModule.DllUnregisterServer(FALSE);
76+
}

dll/test/comtest/stdafx.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// stdafx.cpp : source file that includes just the standard includes
2+
// comtest.pch will be the pre-compiled header
3+
// stdafx.obj will contain the pre-compiled type information
4+
5+
#include "stdafx.h"
6+
7+
// TODO: reference any additional headers you need in STDAFX.H
8+
// and not in this file

dll/test/comtest/stdafx.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// stdafx.h : include file for standard system include files,
2+
// or project specific include files that are used frequently, but
3+
// are changed infrequently
4+
//
5+
6+
#pragma once
7+
8+
#include "targetver.h"
9+
10+
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
11+
// Windows Header Files:
12+
#include <windows.h>
13+
14+
15+
16+
// TODO: reference additional headers your program requires here

dll/test/comtest/targetver.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#pragma once
2+
3+
// Including SDKDDKVer.h defines the highest available Windows platform.
4+
5+
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
6+
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
7+
8+
#include <SDKDDKVer.h>
44 Bytes
Binary file not shown.
29.4 MB
Binary file not shown.

0 commit comments

Comments
 (0)