Primary Surface Resource Sharing Model
DirectDraw has a simple resource sharing model. Display memory is a scarce, shared resource. If the display mode changes, all of the surfaces stored in display memory are lost. (For more information, see Losing Surfaces.)
DirectDraw implicitly creates a GDI primary surface when it is instantiated for a display device that DirectDraw is sharing with GDI. GDI is granted shared access to the primary surface. DirectDraw keeps track of the surface memory that GDI recognizes as the primary surface. The DirectDrawSurface object that owns GDI's primary surface can always be obtained by using the IDirectDraw2::GetGDISurface method.
GDI cannot cache fonts, brushes, and device-dependent bitmaps (DDBs) in the display memory managed by DirectDraw. The HAL must reserve whatever display memory the DIB engine driver needs before describing the available memory to DirectDraw's heap manager or before the display device driver can allocate and free memory for its cached data from DirectDraw's heap manager.