GdiGetDC - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTUSER_H

// rev
/**
 * The GdiGetDC routine provides the operation described below.
 *
 * \param SpoolFileHandle The spool file handle argument.
 *
 * \returns The HDC result described above.
 */
NTSYSAPI
HDC
NTAPI
GdiGetDC(
    _In_ HANDLE SpoolFileHandle
    );

#endif

View code on GitHub
// winppi.h

HDC GdiGetDC(
  HANDLE SpoolFileHandle
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-winppi-gdigetdc)

GdiGetDC function

Description

The GdiGetDC function returns a handle to a printer's device context.

Parameters

SpoolFileHandle

Caller-supplied spool file handle, obtained by a previous call to GdiGetSpoolFileHandle.

Return value

If the operation succeeds, the function returns a device context handle. Otherwise the function returns NULL.

Remarks

The GdiGetDC function is exported by gdi32.dll for use within a print processor's PrintDocumentOnPrintProcessor function.

A print processor can call GdiGetDC to obtain a printer's device context handle anytime after calling GdiGetSpoolFileHandle. The print processor can use the context handle to call Win32 device context functions, in order to perform such operations as applying transformations on the print image.

For additional information, see Using GDI Functions in Print Processors.