Microsoft KB Archive/163878

= CreateBitmap API - Bitmap Size Limits Introduced in Windows NT 4.0 =

Article ID: 163878

Article Last Modified on 11/1/2006

-

APPLIES TO


 * Microsoft Windows NT Workstation 4.0 Developer Edition
 * Microsoft Windows NT Server 4.0 Standard Edition

-



This article was previously published under Q163878



SYMPTOMS
If you have an application that uses the CreateBitmap application programming interface (API) to create bitmaps, you may find it impossible to create bitmaps greater than 48 MB (or less, on computers with limited RAM) when you run the application in Windows NT 4.0.

This limit is not apparent when the application is run in Windows NT 3.51.



CAUSE
This is a side effect of moving display drivers from user mode in Windows NT 3.51 to kernel mode in Windows NT 4.0.

In Windows NT 3.51, the CreateBitmap API allocates the bitmap in user- mode paged memory, and it is therefore possible to create bitmaps up to the maximum size of the pagefile. Bitmap size is therefore limited only by the amount of disk space that you can allocate to your pagefile(s) in Windows NT 3.51.

In Windows NT 4.0, the CreateBitmap API allocates the bitmap in kernel- mode paged memory. As Kernel-mode paged memory is a scarce resource, and exhausting it can adversely affect system performance, application usage of Kernel-mode paged memory is restricted to smaller allocations.



RESOLUTION
To circumvent this limit, the application must be recoded to create bitmaps by calling the CreateDIBSection API instead of the CreateBitmap API.

CreateDIBSection API allocates the bitmap in user-mode paged memory, and bitmaps created using this API are therefore not affected by the limit imposed on kernel-mode paged memory allocations.

Keywords: kbprb KB163878

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.