PRB: "Ring 0 Stack Not Aligned" Error Message

Last reviewed: January 9, 1998
Article ID: Q178654
The information in this article applies to:
  • Windows 95 Device Driver Kit (DDK), version 4.0

SYMPTOMS

When running with the Windows 95 DDK debug binaries, the error message "ERROR: Ring 0 Stack Not Aligned" may occasionally appear.

CAUSE

This is not an indication of a true error, but rather is a debug message that indicates a possible cause of poor performance. When building a debug version of a VxD, the BeginProc macro calls the VMM service _Debug_Flags_Service to assert various conditions. One of the things that this service does is check if the current value of the stack pointer (ESP) is DWORD aligned, and, if not, it issues the error message. This check is performed because accessing a DWORD argument on the stack that is not DWORD aligned causes two memory accesses instead of one, which can degrade performance if the procedure in question is called frequently.

RESOLUTION

This message is only a warning of possible performance degradation, and typically not a cause for concern. However, if the service in question is being called frequently, please insure that it is called with a DWORD aligned stack to prevent any possible performance degradation.

REFERENCES

Windows 95 DDK documentation on _Debug_Flags_Service

Version           : WINDOWS:4.0
Platform          : WINDOWS
Issue type        : kbprb


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 9, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.