[REACTOS] Explicitly link against pseh & include pseh headers in a few places

This commit is contained in:
Jérôme Gardou 2021-04-22 17:28:52 +02:00 committed by Jérôme Gardou
parent 37bc01f42b
commit e470b58376
50 changed files with 103 additions and 23 deletions

View File

@ -33,6 +33,8 @@
#include <shellapi.h>
#include <shlwapi.h>
#include <pseh/pseh2.h>
// #include "resource.h"
#define LVM_PROGRESS (WM_APP + 1) // Used by the subclassed ListView
@ -3895,7 +3897,7 @@ InitPropertiesDlg(HWND hDlg, PEVENTLOG EventLog)
/* By default, it is 604800 (secs) == 7 days. On Server, the retention is zeroed out. */
dwRetention = 0;
}
/* Convert in days, rounded up */
/* Convert in days, rounded up */
if (dwRetention != INFINITE)
dwRetention = (dwRetention + 24*3600 - 1) / (24*3600);
@ -4023,7 +4025,7 @@ SavePropertiesDlg(HWND hDlg, PEVENTLOG EventLog)
LONG Result;
DWORD dwMaxSize = 0, dwRetention = 0;
HKEY hLogKey;
WCHAR *KeyPath;
WCHAR *KeyPath;
SIZE_T cbKeyPath;
if (!EventLog->Permanent)
@ -4054,7 +4056,7 @@ SavePropertiesDlg(HWND hDlg, PEVENTLOG EventLog)
0,
REG_DWORD,
(LPBYTE)&dwMaxSize,
sizeof(dwMaxSize));
sizeof(dwMaxSize));
if (IsDlgButtonChecked(hDlg, IDC_OVERWRITE_AS_NEEDED) == BST_CHECKED)
dwRetention = 0;
@ -4069,7 +4071,7 @@ SavePropertiesDlg(HWND hDlg, PEVENTLOG EventLog)
REG_DWORD,
(LPBYTE)&dwRetention,
sizeof(dwRetention));
RegCloseKey(hLogKey);
}
@ -4100,14 +4102,14 @@ EventLogPropProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code)
{
{
case PSN_APPLY:
PropSheet_UnChanged(GetParent(hDlg), hDlg);
SavePropertiesDlg(hDlg, EventLog);
return (INT_PTR)TRUE;
}
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
@ -4126,7 +4128,7 @@ EventLogPropProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
return (INT_PTR)TRUE;
}
case IDC_EDIT_EVENTS_AGE:
case IDC_EDIT_MAXLOGSIZE:
if (HIWORD(wParam) == EN_CHANGE)
@ -4134,7 +4136,7 @@ EventLogPropProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
PropSheet_Changed(GetParent(hDlg), hDlg);
}
return (INT_PTR)TRUE;
case IDC_OVERWRITE_AS_NEEDED:
{
CheckRadioButton(hDlg, IDC_OVERWRITE_AS_NEEDED, IDC_NO_OVERWRITE, IDC_OVERWRITE_AS_NEEDED);
@ -4161,7 +4163,7 @@ EventLogPropProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
PropSheet_Changed(GetParent(hDlg), hDlg);
return (INT_PTR)TRUE;
}
case IDC_RESTOREDEFAULTS:
{
LoadStringW(hInst, IDS_RESTOREDEFAULTS, szText, _countof(szText));

View File

@ -20,10 +20,7 @@ list(APPEND SOURCE
${CMAKE_CURRENT_BINARY_DIR}/svcctl_s.c)
add_executable(services ${SOURCE} services.rc)
if(NOT MSVC)
target_link_libraries(services ${PSEH_LIB})
endif()
target_link_libraries(services ${PSEH_LIB})
set_module_type(services win32gui UNICODE)
add_importlibs(services userenv user32 advapi32 rpcrt4 msvcrt kernel32 ntdll)

View File

@ -15,6 +15,8 @@
#include <winnls.h>
#include <strsafe.h>
#include <pseh/pseh2.h>
#define NDEBUG
#include <debug.h>

View File

@ -28,6 +28,8 @@
#include "nfs41_np.h"
#include "options.h"
#include <pseh/pseh2.h>
#ifdef DBG
#define DbgP(_x_) NFS41DbgPrint _x_
#else

View File

@ -12,6 +12,8 @@
/* INCLUDES ******************************************************************/
#include <advapi32.h>
#include <pseh/pseh2.h>
WINE_DEFAULT_DEBUG_CHANNEL(advapi);

View File

@ -10,7 +10,7 @@ add_library(kernel32_shared
client/shared_utils.c
client/file/fileutils.c
)
target_link_libraries(kernel32_shared PRIVATE pseh)
add_dependencies(kernel32_shared psdk)
list(APPEND SOURCE

View File

@ -8,6 +8,8 @@
#include "lsasrv.h"
#include <pseh/pseh2.h>
/* GLOBALS *****************************************************************/
static HANDLE SecurityKeyHandle = NULL;

View File

@ -10,6 +10,6 @@ list(APPEND SOURCE
add_library(olecli32 MODULE ${SOURCE})
set_module_type(olecli32 win32dll)
target_link_libraries(olecli32 wine)
target_link_libraries(olecli32 wine ${PSEH_LIB})
add_importlibs(olecli32 ole32 gdi32 msvcrt kernel32 ntdll)
add_cd_file(TARGET olecli32 DESTINATION reactos/system32 FOR all)

View File

@ -8,6 +8,8 @@
#include "samsrv.h"
#include <pseh/pseh2.h>
/* GLOBALS *****************************************************************/
static HANDLE SamKeyHandle = NULL;

View File

@ -25,6 +25,8 @@
#include <pnp_c.h>
#include <winsvc.h>
#include <pseh/pseh2.h>
#include "rpc_private.h"
DWORD

View File

@ -21,6 +21,8 @@
#include "setupapi_private.h"
#include <pseh/pseh2.h>
/* Unicode constants */
static const WCHAR BackSlash[] = {'\\',0};
static const WCHAR DateFormat[] = {'%','u','-','%','u','-','%','u',0};

View File

@ -24,6 +24,8 @@
#include <shlguid.h>
#include <shobjidl.h>
#include <pseh/pseh2.h>
#include "wine/test.h"
#include "apphelp_apitest.h"
@ -299,7 +301,7 @@ static struct
"PROBLEMSEVERITY", "LANGID", "VER_LANGUAGE", "InvalidTag", "ENGINE", "HTMLHELPID", "INDEX_FLAGS", "FLAGS",
"DATA_VALUETYPE", "DATA_DWORD", "LAYER_TAGID", "MSI_TRANSFORM_TAGID", "LINKER_VERSION", "LINK_DATE", "UPTO_LINK_DATE", "OS_SERVICE_PACK",
"FLAG_TAGID", "RUNTIME_PLATFORM", "OS_SKU", "OS_PLATFORM", "APP_NAME_RC_ID", "VENDOR_NAME_RC_ID", "SUMMARY_MSG_RC_ID", "VISTA_SKU",
"DESCRIPTION_RC_ID", "PARAMETER1_RC_ID", "InvalidTag", "InvalidTag", "InvalidTag", "InvalidTag", "InvalidTag", "InvalidTag",
"DESCRIPTION_RC_ID", "PARAMETER1_RC_ID", "InvalidTag", "InvalidTag", "InvalidTag", "InvalidTag", "InvalidTag", "InvalidTag",
"CONTEXT_TAGID", "EXE_WRAPPER", "URL_ID", NULL
}
},

View File

@ -22,6 +22,8 @@
#include <stdio.h>
#include <initguid.h>
#include <pseh/pseh2.h>
#include "wine/test.h"
#include "apphelp_apitest.h"
@ -1081,7 +1083,7 @@ static void test_GetDatabaseInformation(PDB pdb)
ok(pInfo[1].dwSomething == 0xdededede, "Cookie1 corrupt: 0x%x\n", pInfo[1].dwSomething);
ok(pInfo[1].dwMajor == 0xdededede, "Cookie2 corrupt: 0x%x\n", pInfo[1].dwMajor);
}
}
free(pInfo);
}
@ -1185,7 +1187,7 @@ static BOOL IsUserAdmin()
{
BOOL Result;
SID_IDENTIFIER_AUTHORITY NtAuthority = { SECURITY_NT_AUTHORITY };
PSID AdministratorsGroup;
PSID AdministratorsGroup;
Result = AllocateAndInitializeSid(&NtAuthority, 2,
SECURITY_BUILTIN_DOMAIN_RID,
@ -1196,7 +1198,7 @@ static BOOL IsUserAdmin()
{
if (!CheckTokenMembership( NULL, AdministratorsGroup, &Result))
Result = FALSE;
FreeSid(AdministratorsGroup);
FreeSid(AdministratorsGroup);
}
return Result;

View File

@ -21,6 +21,8 @@
#include "wine/test.h"
#include <pseh/pseh2.h>
#include "apphelp_apitest.h"
typedef void* HSDB;

View File

@ -12,6 +12,7 @@ foreach(num RANGE 10 58)
endforeach()
add_library(ms_seh_test ${SOURCE})
target_link_libraries(ms_seh_test pseh)
add_dependencies(ms_seh_test psdk)
if(MSVC)

View File

@ -7,6 +7,8 @@
#include "precomp.h"
#include <pseh/pseh2.h>
void Test_AddFontResourceExW()
{
WCHAR szFileName[MAX_PATH];

View File

@ -9,6 +9,8 @@
#include "init.h"
#include <pseh/pseh2.h>
#define CBM_CREATDIB 2
#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xC0000000C0000000ULL)

View File

@ -7,6 +7,8 @@
#include "precomp.h"
#include <pseh/pseh2.h>
#define ok_lasterror(err) \
ok(GetLastError() == err, "expected last error " #err " but got 0x%lx\n", GetLastError());

View File

@ -7,6 +7,8 @@
#include "precomp.h"
#include <pseh/pseh2.h>
#define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)
void

View File

@ -7,6 +7,8 @@
#include "precomp.h"
#include <pseh/pseh2.h>
void Test_Set(ULONG ulLine, HDC hdc, INT x, INT y, LPPOINT ppt, BOOL bExp, DWORD dwErrExp)
{
BOOL bResult;

View File

@ -9,6 +9,8 @@
#include <ndk/pstypes.h>
#include <ndk/rtlfuncs.h>
#include <pseh/pseh2.h>
/* XP does not have these functions */
static DWORD (WINAPI *pFlsAlloc)(PFLS_CALLBACK_FUNCTION);
static BOOL (WINAPI *pFlsFree)(DWORD);

View File

@ -8,6 +8,8 @@
#include "precomp.h"
#include <pseh/pseh2.h>
static UINT (WINAPI * pEnumSystemFirmwareTables)(DWORD, PVOID, DWORD);
static UINT (WINAPI * pGetSystemFirmwareTable)(DWORD, DWORD, PVOID, DWORD);

View File

@ -15,6 +15,8 @@
#include <winspool.h>
#include <winsplp.h>
#include <pseh/pseh2.h>
#include "../localspl_apitest.h"
#include <spoolss.h>

View File

@ -7,6 +7,8 @@
#include "precomp.h"
#include <pseh/pseh2.h>
typedef struct _TEST_RESOURCES
{
IMAGE_RESOURCE_DIRECTORY TypeDirectory;

View File

@ -10,6 +10,8 @@
#include "precomp.h"
#include <pseh/pseh2.h>
static PVOID Allocations[4096] = { NULL };
static ULONG CurrentAllocation = 0;

View File

@ -8,6 +8,8 @@
#include "precomp.h"
#include <pseh/pseh2.h>
void
Test_PageFileSection(void)
{

View File

@ -7,6 +7,8 @@
#include "precomp.h"
#include <pseh/pseh2.h>
PVOID Buffers[0x100];
START_TEST(RtlAllocateHeap)

View File

@ -2,6 +2,8 @@
#include "precomp.h"
#include <versionhelpers.h>
#include <pseh/pseh2.h>
static BOOL IsBroken = FALSE;
void

View File

@ -6,6 +6,8 @@
*/
#include "precomp.h"
#include <pseh/pseh2.h>
typedef ULONG (NTAPI *FN_RtlMultipleAllocateHeap)(IN PVOID, IN ULONG, IN SIZE_T, IN ULONG, OUT PVOID *);
typedef ULONG (NTAPI *FN_RtlMultipleFreeHeap)(IN PVOID, IN ULONG, IN ULONG, OUT PVOID *);

View File

@ -7,6 +7,8 @@
#include "precomp.h"
#include <pseh/pseh2.h>
#ifdef _MSC_VER
#pragma warning(disable : 4717) // disable warning about recursive function
#endif

View File

@ -7,6 +7,8 @@
#include "precomp.h"
#include <pseh/pseh2.h>
WCHAR dllpath[MAX_PATH];
LONG g_TlsCalled = 0;

View File

@ -20,6 +20,8 @@
#include <imagehlp.h>
#include <mmddk.h>
#include <pseh/pseh2.h>
/* Compatibility with the MS defines */
#ifndef FACILITY_VISUALCPP
@ -198,7 +200,7 @@ FARPROC WINAPI DliHook(unsigned dliNotify, PDelayLoadInfo pdli)
g_VersionDll = LoadLibraryA("version.dll");
return (FARPROC)1;
}
}
else if (dliNotify == dliNotePreGetProcAddress)
{
@ -482,7 +484,7 @@ START_TEST(delayimp)
ok(err == MMSYSERR_INVALHANDLE, "Expected err to be MMSYSERR_INVALHANDLE, was 0x%lx\n", err);
CheckDliDone();
ok(g_BreakFunctionName == false, "Expected the functionname to be changed\n");
/* Make the LoadLib fail, manually load the library in the Failure Hook,
Respond to the dliNotePreGetProcAddress with an alternate function address */
SetExpectedDli(g_sfc_key);

View File

@ -20,6 +20,8 @@
#include <shlwapi.h>
#include <assert.h>
#include <pseh/pseh2.h>
#define EF_FULLPATH 1
#define EF_TESTDATA 2
#define EF_WIN_DIR 4

View File

@ -9,6 +9,8 @@
#include <shlwapi.h>
#include "resource.h"
#include <pseh/pseh2.h>
static BOOL (WINAPI *pSHAreIconsEqual)(HICON hIcon1, HICON hIcon2);
static const char* names[] =

View File

@ -9,6 +9,8 @@
#include <shlwapi.h>
#include "resource.h"
#include <pseh/pseh2.h>
static void execute_test(LPCWSTR DllFile)
{
WCHAR DllBuffer[MAX_PATH + 20];

View File

@ -12,6 +12,8 @@
#include <winbase.h>
#include <spoolss.h>
#include <pseh/pseh2.h>
START_TEST(ReallocSplStr)
{
const WCHAR wszTestString1[] = L"Test";

View File

@ -55,6 +55,7 @@ if(USE_CLANG_CL OR (NOT MSVC))
endif()
set_module_type(kernel32_winetest win32cui)
target_link_libraries(kernel32_winetest pseh)
add_importlibs(kernel32_winetest user32 advapi32 msvcrt kernel32 ntdll)
add_pch(kernel32_winetest precomp.h "${PCH_SKIP_SOURCE}")
add_rostests_file(TARGET kernel32_winetest)

View File

@ -36,6 +36,8 @@ add_executable(ntdll_winetest
${SOURCE}
${PCH_SKIP_SOURCE})
target_link_libraries(ntdll_winetest pseh)
if(USE_CLANG_CL OR (NOT MSVC))
target_compile_options(ntdll_winetest PRIVATE "-Wno-format")
endif()

View File

@ -9,3 +9,5 @@ target_include_directories(atl_classes INTERFACE
target_compile_definitions(atl_classes INTERFACE
"$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<BOOL:$<TARGET_PROPERTY:WITH_CXX_EXCEPTIONS>>>>:_ATL_NO_EXCEPTIONS>")
target_link_libraries(atl_classes INTERFACE pseh)

View File

@ -22,6 +22,7 @@
#pragma once
#include <cguid.h> // for GUID_NULL
#include <pseh/pseh2.h>
namespace ATL
{

View File

@ -603,7 +603,7 @@ if(USE_CLANG_CL)
endif()
add_library(crt ${CRT_SOURCE} ${CRT_WINE_SOURCE} ${crt_asm})
target_link_libraries(crt chkstk)
target_link_libraries(crt chkstk ${PSEH_LIB})
target_compile_definitions(crt
PRIVATE __MINGW_IMPORT=extern
USE_MSVCRT_PREFIX

View File

@ -4,4 +4,5 @@ list(APPEND SOURCE
copysup.c)
add_library(copysup ${SOURCE})
target_link_libraries(copysup PRIVATE pseh)
add_dependencies(copysup bugcodes xdk)

View File

@ -7,4 +7,5 @@ list(APPEND SOURCE
rdbss.c)
add_library(rdbsslib ${SOURCE})
target_link_libraries(rdbsslib PRIVATE pseh)
add_dependencies(rdbsslib bugcodes xdk)

View File

@ -6,4 +6,5 @@ list(APPEND SOURCE
rxce.c)
add_library(rxce ${SOURCE})
target_link_libraries(rxce PRIVATE pseh)
add_dependencies(rxce bugcodes xdk)

View File

@ -112,6 +112,7 @@ endif()
add_asm_files(rtl_asm ${ASM_SOURCE})
add_library(rtl ${SOURCE} ${rtl_asm})
target_link_libraries(rtl PRIVATE pseh)
add_pch(rtl rtl.h SOURCE)
add_dependencies(rtl psdk asm)
@ -124,3 +125,4 @@ list(APPEND SOURCE_VISTA
add_library(rtl_vista ${SOURCE_VISTA})
add_pch(rtl_vista rtl_vista.h SOURCE_VISTA)
add_dependencies(rtl_vista psdk)
target_link_libraries(rtl_vista PRIVATE pseh)

View File

@ -1,5 +1,7 @@
#include <precomp.h>
#include <pseh/pseh2.h>
#define NDEBUG
#include <debug.h>

View File

@ -23,4 +23,5 @@ list(APPEND SOURCE
rosglue.c)
add_library(winegdi ${SOURCE})
target_link_libraries(winegdi PRIVATE pseh)
add_dependencies(winegdi psdk)

View File

@ -9,6 +9,8 @@
#include <shlobj.h>
#include <undocshell.h>
#include <pseh/pseh2.h>
#define MAX_GETPRINTER_SIZE 4096 - MAX_PATH
typedef void (WINAPI *PPfpSHChangeNotify)(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2);
@ -160,7 +162,7 @@ IntProtectHandle( HANDLE hSpooler, BOOL Close )
// 2 : Close and/or shared
// 1 : Failed Handle
// 0 : In use.
return Ret;
return Ret;
}
//
// This one too.

View File

@ -53,6 +53,7 @@ else()
endif()
add_library(consrv ${CONSRV_SOURCE})
target_link_libraries(consrv pseh)
add_dependencies(consrv psdk)
add_pch(consrv consrv/consrv.h CONSRV_SOURCE)
#add_object_library(consrv ${CONSRV_SOURCE})

View File

@ -10,6 +10,7 @@ list(APPEND USERSRV_SOURCE
usersrv/usersrv.h)
add_library(usersrv ${USERSRV_SOURCE})
target_link_libraries(usersrv pseh)
add_dependencies(usersrv xdk)
add_pch(usersrv usersrv/usersrv.h USERSRV_SOURCE)
#add_object_library(usersrv ${USERSRV_SOURCE})