Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/248018

From BetaArchive Wiki

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.



REFERENCES

For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:

Q194924 INFO: Behavior of GetFreeSystemResources() on 32-Bit Windows

Q190217 HOWTO: Get Free System Resources in 32-Bit Visual Basic

Q179365 INFO: Run, RunOnce, RunServices, RunServicesOnce and Startup

Additional query words:

Keywords : kbAPI kbKernBase kbResource kbSDKWin32 kbOSWin95 kbOSWin98 kbDSupport kbGrpDSKernBase
Issue type : kbprb
Technology : kbAudDeveloper kbWin32sSearch kbWin32API


Last Reviewed: December 16, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.