Files
raven/testdata/native_loader/delay_setupapi_client.c
T
mirkobrombin cea6ca7a7a feat: resolve delay-loaded system libraries to the runtime's components
Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: Made the loader follow delay imports when choosing components, with a delay-load test.
2026-10-27 10:32:01 +00:00

23 lines
641 B
C

#include <windows.h>
#include <setupapi.h>
#include <delayimp.h>
PfnDliHook __pfnDliNotifyHook2 = NULL;
PfnDliHook __pfnDliFailureHook2 = NULL;
static UINT CALLBACK visit(PVOID context, UINT notification, UINT_PTR first, UINT_PTR second)
{
++*(int *)context;
return NO_ERROR;
}
/* A program that loads the setup API only lazily, as large installers delay-load it, still extracts cabinets through it: a cabinet that
* does not exist is refused without visiting any file. */
int raven_entry(void)
{
int visited = 0;
if (SetupIterateCabinetW(L"C:\\raven-missing.cab", 0, visit, &visited)) return 1;
if (visited) return 2;
return 0;
}