GdiGetPageHandle - NtDoc

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

// rev
/**
 * The GdiGetPageHandle routine provides the operation described below.
 *
 * \param SpoolFileHandle The spool file handle argument.
 * \param PageNumber The page number argument.
 * \param PageType Receives the page type.
 *
 * \returns The HANDLE result described above.
 */
NTSYSAPI
HANDLE
NTAPI
GdiGetPageHandle(
    _In_ HANDLE SpoolFileHandle,
    _In_ DWORD PageNumber,
    _Out_opt_ DWORD *PageType
    );

#endif

View code on GitHub
// winppi.h

HANDLE GdiGetPageHandle(
  HANDLE  SpoolFileHandle,
  DWORD   Page,
  LPDWORD pdwPageType
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

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

Description

The GdiGetPageHandle function returns a handle to the specified page within a print job.

Parameters

SpoolFileHandle

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

Page

Caller-supplied page number.

pdwPageType

Caller-supplied pointer to a location that receives the page type. The possible page types are shown in the following table:

Page Type Meaning
EMF_PP_FORM The page is a form or has a watermark. (Not currently supported.)
EMF_PP_NORMAL The page is a normal page.

Return value

If the operation succeeds, the function returns TRUE. Otherwise the function returns FALSE, and an error code can be obtained by calling GetLastError.

Remarks

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

Print processors must obtain a page handle before calling GdiPlayPageEMF to draw a page. If a Page value is specified that is too large, the function returns ERROR_NO_MORE_ITEMS.

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