2 * PROJECT: ReactOS API tests
3 * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
4 * PURPOSE: Test for static C++ object construction/destruction in a DLL
5 * PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
9 #include "dll_startup.h"
11 static struct counter_values counter_values
=
13 0, 0, 0, 0, 5656, 0, 0
15 static struct counter_values
*p_counter_values
;
17 static struct init_static
25 counter_values
.static_construct_counter_at_startup
= counter_values
.static_construct_counter
;
26 counter_values
.m_uninit_at_startup
= m_uninit
;
27 counter_values
.static_construct_counter
++;
33 p_counter_values
->dtor_counter
++;
39 SET_COUNTER_VALUES_POINTER SetCounterValuesPointer
;
42 SetCounterValuesPointer(
43 _Out_
struct counter_values
*pcv
)
45 p_counter_values
= pcv
;
46 memcpy(pcv
, &counter_values
, sizeof(counter_values
));
52 _In_ HINSTANCE hinstDLL
,
54 _In_ PVOID pvReserved
)
56 if (fdwReason
== DLL_PROCESS_ATTACH
)
58 counter_values
.m_uninit
= init_static
.m_uninit
;
59 counter_values
.m_counter
= init_static
.m_counter
;
61 else if (fdwReason
== DLL_PROCESS_DETACH
)
63 p_counter_values
->dtor_counter_at_detach
= p_counter_values
->dtor_counter
;