SURFOBJ

typedef struct _SURFOBJ {

    DHSURF dhsurf;

    HSURF  hsurf;

    DHPDEV dhpdev;

    HDEV   hdev;

    SIZEL  sizlBitmap;

    ULONG  cjBits;

    PVOID  pvBits;

    PVOID  pvScan0;

    LONG   lDelta;

    ULONG  iUniq;

    ULONG  iBitmapFormat;

    USHORT iType;

    USHORT fjBitmap;

} SURFOBJ;

The SURFOBJ structure is the user object for a surface. A device driver usually calls methods on a surface object only when the surface object represents a GDI bitmap or a device-managed surface.

Members

dhsurf

If the surface is a device managed surface, this member is a device handle identifying the surface. Otherwise, this member is zero.

hsurf

Identifies the surface.

dhpdev

Identifies the device’s PDEV that is associated with the specified surface.

hdev

GDI’s logical handle for the PDEV associated with this device.

sizlBitmap

Specifies the size of the surface, in pixels.

cjBits

Specifies the size of the buffer pointed to, if pvBits is not null.

pvBits

Points to the surface’s pixels, if the surface is a standard format bitmap. Otherwise, this member is null.

pvScan0

Points to the first scanline of the bitmap.

lDelta

Specifies the count of bytes required to move down one scan line in the bitmap.

iUniq

Specifies the current state of the specified surface. Every time the surface changes this value is incremented; this enables drivers to cache source surfaces.

iBitmapFormat

Specifies the standard format most closely matching this surface. If the iType member specifies a bitmap (STYPE_BITMAP), this member specifies its format. Windows NT supports a set of predefined formats, although applications can also send device-specific formats by using SetDIBitsToDevice. Supported predefined formats include the following:

Value Meaning
BMF_1BPP 1 bit per pixel.
BMF_4BPP 4 bits per pixel.
BMF_8BPP 8 bits per pixel.
BMF_16BPP 16 bits per pixel.
BMF_24BPP 24 bits per pixel.
BMF_32BPP 32 bits per pixel.
BMF_4RLE 4 bits per pixel, run length encoded.
BMF_8RLE 8 bits per pixel, run length encoded.

iType

Surface type, which is one of the following:

Type Definition
STYPE_BITMAP The surface is a bitmap.
STYPE_DEVICE The surface is managed by the device.
STYPE_DEVBITMAP The surface is a device format bitmap.

fjBitmap

If the surface is of type STYPE_BITMAP and is a standard noncompressed format bitmap, the following flag can be set. Otherwise, this member should be ignored.

Value Meaning
BMF_TOPDOWN The first scan line represents the top of the bitmap.
BMF_NOZEROINIT The bitmap was not zero-initialized.
BMF_DONTCACHE The bitmap should not be cached by the driver because it is a transient bitmap, created by GDI, that the driver will never see again.

Comments

When information about a particular surface is required by a driver, the driver must access the SURFOBJ. This structure allows quick access to the properties of the surface.

When a SURFOBJ structure represents a GDI bitmap, the driver must be able to determine the format of the bitmap and locate the bitmap bits.

When a SURFOBJ structure represents a device surface, the driver must be able to locate the device handle for the surface.