The DrvDeviceCapabilities function is not exported from winspool.drv but can be obtained as follows -
Minimal example tested on Win10 22H2
#include <Windows.h>
#include <winddiui.h>
#include <stdio.h>
#include <tchar.h>
#include <memory>
typedef decltype(DrvDeviceCapabilities)* DDC;
int main()
{
HANDLE hPrinter{};
DWORD cbNeeded{};
if (OpenPrinter((LPTSTR)_T("Microsoft Print to PDF"), &hPrinter, NULL))
{
if (!GetPrinterDriver(hPrinter, NULL, 2, NULL, 0, &cbNeeded) && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{
std::unique_ptr<BYTE[]> buf = std::make_unique<BYTE[]>(cbNeeded);
if (GetPrinterDriver(hPrinter, NULL, 2, buf.get(), cbNeeded, &cbNeeded))
{
PDRIVER_INFO_2 pdrv2 = (PDRIVER_INFO_2) buf.get();
_tprintf_s(_T("DLL to load: %s\n"), pdrv2->pConfigFile);
HMODULE hMod = LoadLibrary(pdrv2->pConfigFile);
if (hMod)
{
DDC pfDrvDeviceCapabilities = (DDC)GetProcAddress(hMod, "DrvDeviceCapabilities");
if (pfDrvDeviceCapabilities)
_tprintf_s(_T("GetProcAddress succeeeded!\n"));
else
_tprintf_s(_T("GetProcAddress error ws %d\n"), GetLastError());
FreeLibrary(hMod);
}
else
_tprintf_s(_T("LoadLibrary error ws %d\n"), GetLastError());
}
else
_tprintf_s(_T("GetPrinterDriver error was %d\n"), GetLastError());
}
else
_tprintf_s(_T("GetPrinterDriver error was %d\n"), GetLastError());
ClosePrinter(hPrinter);
}
return 0;
}