Jump to content

ResetDCState

From EDM2
Revision as of 14:05, 3 April 2025 by Ak120 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

OS2_PM_DRV_ENABLE: ResetDCState resets the device context to its original initialized state.

Syntax

ResetDCState(ulSubfunction, pParam1, pParam2)

Parameters

ulSubfunction (ULONG) - input
09h
pParam1 (PULONG) - input
A pointer (pInstance) to the DC instance data.
pParam2 (PLONG) - input
Reserved.

Return Code

rc (LONG) - returns
Return codes.
The handling routine should return a LONG integer. Valid values are:
  • 0 Successful
  • -1 Error

Remarks

The presentation driver deletes all fonts, patterns, and paths, and resets all attributes to their default values. Note that when resources are not owned by the presentation driver, the driver saves the relevant values so that they are available to reset the device context. A typical example is when the default font is a graphics engine font. In this case, the presentation driver saves the font flags and address passed in the first call to GreDeviceSetAttributes.

The visible region and the DC origin are not affected by this function.

Sample Code

#include <os2.h>

ULONG     ulSubfunction;  /*  09h */
PULONG    pParam1;
PLONG     pParam2;        /*  Reserved. */
LONG      rc;             /*  Return codes. */

rc = ResetDCState(ulSubfunction, pParam1, pParam2);