RestoreDCState
Appearance
OS2_PM_DRV_ENABLE: RestoreDCState restores a specific DC state from the saved DC states.
Syntax
RestoreDCState(ulSubfunction, pParam1, pParam2);
Parameters
- ulSubfunction (ULONG) - input
- 08h.
- pParam1 (PULONG) - input
- A pointer (pInstance) to the DC instance data.
- pParam2 (PLONG) - input
- Identifies which of the saved states are to be restored. Positive numbers indicate the specific state counting from the first saved state, that is, 1 equals the first, 2 the second, and so forth. All saved states following the one being restored are discarded. Preceding states remain saved.
- Negative numbers indicate the specific state counting from the last saved state, a value of -2 indicates that the last state is discarded and the state before that is restored.
Return Code
- rc (LONG) - returns
- Return codes.
- The handling routine should return a LONG integer. Valid values are:
- 0 Successful
- -1 Error
Remarks
An index to the required state is supplied as Parameter 2. The presentation driver returns an error if the index is 0 or if it specifies a value that does not identify a saved state.
Display drivers must be careful when handling this call. Some of the data stored in the DC instance data must match the data held by the Window Manager. The handling routine for RestoreDCState does not restore:
- DC origin
- User bounds
- Cached clipping rectangles
- HDC_IS_DIRTY flag
Sample Code
#include <os2.h> ULONG ulSubfunction; /* 08h. */ PULONG pParam1; PLONG pParam2; LONG rc; /* Return codes. */ rc = RestoreDCState(ulSubfunction, pParam1, pParam2);