[DELAYIMP] Separate hook symbols from library code

This allows to define these functions in the importing module.
This commit is contained in:
Timo Kreuzer
2025-05-16 11:01:52 +03:00
parent 85aff698ca
commit 5840b212a8
4 changed files with 29 additions and 3 deletions

View File

@@ -1,5 +1,9 @@
add_definitions(-DUNICODE -D_UNICODE)
add_library(delayimp delayimp.c)
add_library(delayimp
delayimp.c
pfnDliFailureHook2.c
pfnDliNotifyHook2.c
)
add_dependencies(delayimp psdk)
add_importlibs(delayimp kernel32)

View File

@@ -14,8 +14,8 @@
/**** Linker magic: provide a default (NULL) pointer, but allow the user to override it ****/
/* The actual items we use */
PfnDliHook __pfnDliNotifyHook2;
PfnDliHook __pfnDliFailureHook2;
extern PfnDliHook __pfnDliNotifyHook2;
extern PfnDliHook __pfnDliFailureHook2;
#if !defined(__GNUC__)
/* The fallback symbols */

View File

@@ -0,0 +1,11 @@
/*
* PROJECT: ReactOS delayimport Library
* LICENSE: MIT (https://spdx.org/licenses/MIT)
* PURPOSE: __pfnDliFailureHook2 symbol for delayimport library
* COPYRIGHT: Copyright 2025 Timo Kreuzer <timo.kreuzer@reactos.org>
*/
#include <windef.h>
#include <delayimp.h>
PfnDliHook __pfnDliFailureHook2;

View File

@@ -0,0 +1,11 @@
/*
* PROJECT: ReactOS delayimport Library
* LICENSE: MIT (https://spdx.org/licenses/MIT)
* PURPOSE: __pfnDliNotifyHook2 symbol for delayimport library
* COPYRIGHT: Copyright 2025 Timo Kreuzer <timo.kreuzer@reactos.org>
*/
#include <windef.h>
#include <delayimp.h>
PfnDliHook __pfnDliNotifyHook2;