[SETUPLIB] Add a setuplib_static library, used for the dll and the unit-tests.

Since the setuplib.dll isn't available after installing ReactOS, build
instead a static library that is then used for the dll, and linked into
the setuplib_unittest, so that it can be run in our test-suite.

Addendum to commit d7c1d220.
This commit is contained in:
Hermès Bélusca-Maïto 2025-04-20 18:15:22 +02:00
parent 2c2cdfddd3
commit f135cab83e
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
4 changed files with 58 additions and 31 deletions

49
base/setup/lib/main.c Normal file
View file

@ -0,0 +1,49 @@
/*
* PROJECT: ReactOS Setup Library
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: DLL Main Routine
* COPYRIGHT: Copyright 2025 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
*/
/* INCLUDES ******************************************************************/
/* PSDK/NDK Headers */
#define WIN32_NO_STATUS
#include <windef.h>
#include <winbase.h>
#define NTOS_MODE_USER
// #include <ndk/umfuncs.h>
#include <ndk/rtlfuncs.h>
/* GLOBALS *******************************************************************/
extern HANDLE ProcessHeap;
/* ENTRY-POINT ***************************************************************/
/* Declared in ndk/umfuncs.h */
NTSTATUS
NTAPI
LdrDisableThreadCalloutsForDll(
_In_ PVOID BaseAddress);
BOOL
NTAPI
DllMain(
_In_ HINSTANCE hDll,
_In_ ULONG dwReason,
_In_opt_ PVOID pReserved)
{
UNREFERENCED_PARAMETER(pReserved);
if (dwReason == DLL_PROCESS_ATTACH)
{
LdrDisableThreadCalloutsForDll(hDll);
ProcessHeap = RtlGetProcessHeap();
}
return TRUE;
}
/* EOF */