Microsoft KB Archive/248018

{|
 * width="100%"|

PRB: The Operating System May Establish an Unusually High Baseline for GetFreeSystemResources

 * }

Q248018

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), included with:
 * Microsoft Windows 98
 * Microsoft Windows 95

-

SYMPTOMS
Windows 95 and Windows 98 set a baseline value for calculating system resources during the startup phase of the operating system. The computer expects the first call to the GetFreeSystemResources function to come from the shell, after most of the other operating system components have been fully initialized. The value obtained from this first call is then used as a baseline for additional calls to the GetFreeSystemResources function.

If a Windows 95 or Windows 98 service calls the GetFreeSystemResources function prior to the shell's initial call, the computer may set an unusually high value as the resource-use baseline. This causes all following calls to the GetFreeSystemResources function to return incorrect values.

CAUSE
This behavior is by design.

RESOLUTION
Windows 95 and Windows 98 services should not call the GetFreeSystemResources function.

MORE INFORMATION
An application on a Windows 95- or Windows 98-based computer can persist across user logon sessions by registering itself as a service. The application performs this registration by calling the RegisterServiceProcess function. The application can be started prior to a user logging on to the system (during system initialization) by placing a registry value in the following key:

"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices" A 32-bit program should not attempt to call the GetFreeSystemResources function. The GetFreeSystemResources function is a 16-bit function that was originally designed to return the free percentage of system, GDI, and user resources under Windows 3.1x. Because of architectural changes in the way resources are allocated under 32-bit Windows systems, it is not appropriate to call the GetFreeSystemResources function on Win32 platforms. However, most Win32 platforms provide a 16-bit version of the GetFreeSystemResources function to meet backward compatibility requirements.